How to insert new document in a MongoDB
collection if there's no other document with specified unique field exists, or update the existing one otherwise?
Is there anything more reasonable than just using findOne
and save
methods with some conditions?