You could include a counter field in the document, and when tags are
added, the field is incremented. This field allows you to prevent
updates if counter <10:
db.collection.update({_id: 1, counter : {$lt : 10}, tags: {$ne:
newTag}}, {$inc : {counter: 1}, $push : {tags: newTag}})
On Jun 22, 2:55 pm, "मैं एक भारतीय बेवकूफ हूँ"