Answer the question
In order to leave comments, you need to log in
How to implement many update or insert?
there is a model with a unique field, so you need to insert a lot of records there so that new ones are inserted, and duplicates do not appear.
now, when inserting, if there is at least 1 duplicate, it simply cancels the entire request with an errorMongoError: E11000 duplicate key error collection
Answer the question
In order to leave comments, you need to log in
Check it out if you have any questions - write
https://docs.mongodb.com/v3.0/reference/method/db....
https://docs.mongodb.com/manual/reference/method/d...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question