I have a document in mongodb, like this one:
{ "_id" : "a", "array" : [ { "aa" : "11", "bb" : "22" } ] }
I want to insert an array in the array above, so the result looks like:
{"_id":"a","array":[{"aa":"11","bb":"22","cc":[{mm:"11"},{mm:"22"}]}]}
I am writing a node.js program and using the mongojs module to connect to mongodb. I have tried using db.collection.aggregate({"$unwind":"$name"}), but I don't know how to solve this.
ccto the array in the document in the database or only during a read?