{"name":"test","tag":[{"tname":"a","ttype":"atype"},{"tname":"b","ttype":"btype"}]}
想往mongod裡插入類似上面的資料(資料中有一個內嵌的清單),直接在mongo的shell裡操作,該怎麼寫呢?
好吧 自問自答好了
db.test.insert({ "name":"test", "tag":[ {"tname":"a","ttype":"atype"},{"tname":"b","ttype":"btype"} ] });
好吧 自問自答好了