Hi,
My collection is something like this,
{
"_id" : ObjectId("5077e898e4b05e76f3b6f392"),
"questions" : [
{
"questionID" : 1,
"section" : "general"
}
]
}
I wanted to add elements to the questions array based on the users visit, For e.g if the user visits question # 2 then the document should be updated something like this,
{
"_id" : ObjectId("5077e898e4b05e76f3b6f392"),
"questions" : [
{
"questionID" : 1,
"section" : "general"
},
]
}
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
Those two documents are the same.
However I am guessing you wish to push a new subdocument to the questions field. You can use $push for this: http://www.mongodb.org/display/DOCS/Updating#Updating-%24push