express-restify-mongoose
express-restify-mongoose copied to clipboard
Option to use InsertMany when creating array of objects
Looking through the code, it seems the standard mongoose create method is also used when passing an array of objects.
Would it be possible to add an option to use InsertMany instead when passing an array of objects? InsertMany is faster as it will only send one operation to database instead of one for each document.
https://mongoosejs.com/docs/api/model.html#model_Model.insertMany
Thanks, Rune
As far as I can remember, the only reason we don't use insertMany
is that it didn't exist back then.