desperately I look for a solution of a very simple problem. I use NINJA and Robomongo as environment.
I want to add a collection to an existing one, all in the same FOR loop:
existing:
{
"_id" : ObjectId("54608d9f35121b0e18aa01b2"),
"level1" : {
"item1" : 200.55,
"item2" : "001",
"item3" : 708874,
}
}
want to get:
{
"_id" : ObjectId("54608d9f35121b0e18aa01b2"),
"level1" : {
"item1" : 200.55,
"item2" : "001",
"item3" : 708874,
"level2" : {
"item4" : 200.55,
"item5" : "001",
"item6" : 708874,
}
}
}
I tried UPDATE with $set (unset=True), $addToSet etc. Problem seems that it's not an array.
Thanx for help