> use test
switched to db test
> post
{ "a" : 1, "b" : 2, "c" : "3" }
> db.blog.insert(post)
WriteResult({ "nInserted" : 1 })
> db.blog.find()
{ "_id" : ObjectId("5ca812e664957f8577f08112"), "a" : 1, "b" : 2, "c" : "3" }
> db.blog.findOne()
"_id" : ObjectId("5ca812e664957f8577f08112"),
"a" : 1,
"b" : 2,
"c" : "3"
}
> post.d = [{"1":1}]
[ { "1" : 1 } ]
> post
{ "a" : 1, "b" : 2, "c" : "3", "d" : [ { "1" : 1 } ] }
> db.blog.update({a:1}, post)
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.blog.remove({a:1})
WriteResult({ "nRemoved" : 2 })
> db.blog.find()