Hi,
My collection is something like this,
{
"_id" : ObjectId("5077e898e4b05e76f3b6f392"),
"questions" : [
{
"questionID" : 1,
"section" : "general"
},
]
}
I wanted to update questions array based on the users visit, suppose if user visits
question#2 then one more element should be added to the document like this,
{
"_id" : ObjectId("5077e898e4b05e76f3b6f392"),
"_class" : "com.citizenshipschool.domain.PracticeQuestion",
"questions" : [
{
"questionID" : 1,
"section" : "general"
},
{
"questionID" : 2,
"section" : "science"
}
]
}
But if I use save() question #1 is getting updated with question #2 instead of
appending to it.
Also if user again visits a page which is already in the questions array for e.g. question #1
then the document shouldn't get updated.
Is there a way to achieve this using the mongodb java driver.
Thanks for any suggesstions
RK
--
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