0

I'm running some tests with Restheart, but can't find how to execute a findAndModify in it via curl or httpie. Has anyone done that?

1 Answers1

0

In RESTHeart all write requests have upsert semantic, in other words they all end up with a findAndModify operation.

If you need to update several documents with one single request, you can use the bulk write request, example:

PATCH /db/coll/*?filter={"qty":{"$lte":20}} {"$inc": {"qty": 1}}

Note the wildcard * as the document id in the resource URI.

Have a look at write requests documentation section for more information.

Andrea Di Cesare
  • 1,125
  • 6
  • 11