> db.test1.ensureIndex({a:1},{unique:true}){ "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1}
> db.test1.insert({ "_id" : 2, "a" : [ 1, 2, 3, 1 ] })WriteResult({ "nInserted" : 1 })
> db.test1.update({_id:2}, { $push: { a : 1 }})WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.test1.update({_id:2}, { $push: { a : 1 }})WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })> db.test1.update({_id:2}, { $addToSet: { a : 1 }})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 0 })
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/ce83c6db-8f8c-42b2-b264-c71239b43c49%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/lysCzKS9Jgc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.