express-restify-mongoose icon indicating copy to clipboard operation
express-restify-mongoose copied to clipboard

How to do bulk or single Upsert

Open abhishekvaid opened this issue 7 years ago • 1 comments

It is completely undocumented and I'm not able to find answer the question: How to upsert in bulk or single mode. In other words, is hitting the POST with multiple documents (since this plugin only exposes POST with list-like payload) a good idea or hitting each individual document in a list with a PUT ? I've tried various things but none of it seems to be working. If someone can give a one line answer with an example, it'll be very very helpful.

A related question would be to give status for bulk request. Where one status document is sent back for each document sent. Currently, only first document failure is returned in response for a bulk POST request.

abhishekvaid avatar Dec 01 '17 14:12 abhishekvaid

The library is support upsert now in the options :)

wizardnet972 avatar Nov 17 '19 14:11 wizardnet972