It should be easy, but I can’t figure it out ... Let's say I had a collection users, and this is the first item in the collection:
{
"_id" : ObjectId("4d8653c027d02a6437bc89ca"),
"name" : "Oscar Godson",
"email" : "oscargodson@xxx.com",
"password" : "xxxxxx",
"tasks" : [
{
"task" : "pick up stuff",
"comment" : "the one stuff over there"
},
{
"task" : "do more stuff",
"comment" : "lots and lots of stuff"
}
] }
As with the PHP driver for MongoDB, I will then go over and add another "task" to the "tasks" array in this element in the collection
source
share