I want to insert a new document in Mongo only if a certain number of matching documents is not present, in which case the first matching document should be deleted and new o