I'm trying to add sub-id to my array elements but I get an error when I try to save this object using Robomongo:
{
"_id": ObjectId("540098e2c9502ce88820bfc3"),
"foo": "bar",
"objects": [
{
"_id": new ObjectId(),
"name": "a"
},
{
"_id": new ObjectId(),
"name": "b"
}
]
}
Error:
"new" keyword not followed by Date constructor.
What am I doing wrong?