How best to batch POST / PUT requests to BAAS?

Not applicable

The PUT / update part of this question is encapsulated by this StackOverflow question:

http://stackoverflow.com/questions/26135639/update...

Question at time of writing:

Update large datasets in apigee baas?

I have a scenario where a collection in the BaaS will have to be updated frequently. As I understand, to insert entities into a collection, I can do single HTTP POST requests with the payload containing an array of entities.

However, using HTTP PUT, I have to insert a single entity per request and I'm not sure about its performance.

What is the best / recommended way of updating a collection with a large number of entities?

There is documentation here:

http://apigee.com/docs/app-services/content/updati...

But it seems to be to update all entities in a collection, rather than specific ones (identified by either their name or UUID, which is really what I am after). My use case could be described as wanting to do this, but with a SQL WHERE clause attached, is this possible?

For POSTing requests, this:

https://groups.google.com/forum/#!topic/usergrid/u...

...indicates you can essentially wrap JSON entities in an array, which I presume is the best way of going about things?

Thanks,

-Rob

Solved Solved
1 3 2,052
1 ACCEPTED SOLUTION

Not applicable

Hey Rob,

You bet. If you include the ?ql= parameter with an appropriate query when you do the PUT, it will only update the items that match your query.

Scott

View solution in original post

3 REPLIES 3

Not applicable

The ql clause shown in http://apigee.com/docs/app-services/content/updating-collections is a Usergrid query language string. When posting entities to a collection, putting entities in a JSON array and entering multiple entries at once is a best practice.

Hi Michael,

Thanks for your reply - that's the same link as in my question. The example shown seems to imply that it will update all of the entries in a collection. To restrict the update to specific entries, do I have to include the UUID or name for the entry row to be updated in the JSON array, or does that have to be in a WHERE condition added to the query string? (Or is there some other mechanism?)

Thanks,

-Rob

Not applicable

Hey Rob,

You bet. If you include the ?ql= parameter with an appropriate query when you do the PUT, it will only update the items that match your query.

Scott