Unicity in insert in meteor mongo

No - find is an asynchronous method (even though Meteor hides that very well) and so interleaving is possible and multiple inserts could be given the same value for crs_numero.

You should look at using findOneAndUpdate to manage unique counters, which is available as a Promise from Courses.rawCollection().findOneAndUpdate(). I use this to generate “auto-increment” numbers in MongoDB collections. I’ve got a similar example posted here using the now deprecated findAndModify and wrapAsync (also not needed anymore).

Check out this article for information in how to use async and await instead of wrapAsync here: