Closed haojia321 closed 7 years ago
No, you'll need to validate all docs before inserting
Hi @aldeed, Yes, thats what we are doing now. We use check(obj, collection.simpleschema()); to check if obj is valid.
So if I have autoValue been set in simpleschema, do you know if their is a way I can programmatically generate the autoValue before use check()?
Will simple schema still work if I use bulk insert?
https://docs.mongodb.com/manual/reference/method/Bulk.insert/#Bulk.insert
We need to write below code to achieve Mongodb's bulk insert var bulk = UserNotifications.rawCollection().initializeUnorderedBulkOp(); ... bulk.execute();