These are chat archives for Automattic/mongoose
You actually get pretty good performance if you eschew Mongoose in this one instance and try to implement a raw MongoDB call itself. Basically, if I have a schema called
Profile and I want to insert a large number of document simultaneously, I'll just use (if I'm recalling correctly):
docs is an array of N documents that I want to insert into the collection.
Unless you mean you're inserting just one document but it's very large in which case, I don't think there's anything else you can do but get better hardware.
Did you know, it's cheaper to buy 25% faster hardware than it is to write 25% faster software?
.execute().then(...)) otherwise your memory may fill up with queued batches! http://stackoverflow.com/questions/25285232/bulk-upsert-in-mongodb-using-mongoose