For example ...
update 1 contains:
1 One
2 Two
5 Five
After the update, I want the database to contain
1 One
2 Two
5 Five
update 2 contains:
3 Three
4 Four
After the update, I want the database to contain
1 One
2 Two
3 Three
4 Four
5 Five
update 3 contains
2 New Two
4 New Four
After the update, I want the database to contain
1 One
2 New Two
3 Three
4 New Four
5 Five
Can someone please suggest an optimal way to code this? I'm new to
mongodb and finding the description of the modifier, upsert API a bit
hard to unravel. I can see ways to do it but which way is best.
Thanks
db.foo.update( { _id : ... } , { $inc : { "map.0" : 2 , "map.5" : 54 }
} , true )
> --
> 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.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>