我想在mongodb中插入一个嵌套对象,并将第一个代码插入数据库
;db.told.insert({
name: "admin",
status: "online",
catalog : [
{
"objectid" : ObjectId().str,
"message" : "sold",
"status" : "open"
}]
})
但这不是
db.told.insert({
communicationtype:"sms",
communicationmessage:[{
"objectid" : ObjectId().str,
"1" : "House",
"2" : "Flat",
"3" : "Bungalow",
"4" : "Maisonette"
}],
communicationsenton:"a",
communicationsentby:"b",
communicationstatus:"sent"
})
为什么第二个语句没有插入?