How to do bulk insertion through Mongo sails and sails.js?

Is there a way to do bulk insertion through Mongo sails. So, if I pass an array of documents to the model creation method, will it insert every document into this array atomically into the database?

+8
mongodb sails-mongo
source share
1 answer

It works exactly as you asked:

Model.create([{foo: "first},{foo:"2nd"}]).exec(... 

See http://beta.sailsjs.org/#/documentation/reference/Models/Model-Methods/create.html

+12
source share

All Articles