{
"_id" : ObjectId("59f005402844ff254a1b68f6"),
"name" : "三国演义",
"authorName" : "罗贯中",
"authorGender" : "男",
"authorAge" : 99.0
}
{
"_id" : ObjectId("59f005402844ff254a1b68f6"),
"name" : "三国演义",
"author" : {
"name" : "罗贯中",
"gender" : "男",
"age" : 99.0
}
}
{ "_id" : ObjectId("59f00d4a2844ff254a1b68f7"), "x" : 1 }
{ "_id" : ObjectId("59f00d4a2844ff254a1b68f8"), "x" : 1 }
{ "_id" : ObjectId("59f00d4a2844ff254a1b68f9"), "x" : 1 }
{ "_id" : ObjectId("59f00d4a2844ff254a1b68fa"), "x" : 2 }
db.sang_collect.update({x:1},{x:99})
{ "_id" : ObjectId("59f00d4a2844ff254a1b68f7"), "x" : 99 }
{ "_id" : ObjectId("59f00d4a2844ff254a1b68f8"), "x" : 1 }
{ "_id" : ObjectId("59f00d4a2844ff254a1b68f9"), "x" : 1 }
{ "_id" : ObjectId("59f00d4a2844ff254a1b68fa"), "x" : 2 }
db.sang_collect.update({x:1},{$set:{x:99}},false,true)
{x:1,y:2,z:3}
db.sang_collect.update({x:1},{x:99})
{ "_id" : ObjectId("59f02dce95769f660c09955b"), "x" : 99 }
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "罗贯中",
"gender" : "男"
}
}
db.sang_collect.update({name:"三国演义"},{$set:{"author.name":"明代罗贯中"}})
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "明代罗贯中",
"gender" : "男"
}
}
db.sang_collect.update({name:"三国演义"},{$inc:{"author.age":99}})
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "明代罗贯中",
"gender" : "男",
"age" : 99.0
}
}
db.sang_collect.update({name:"三国演义"},{$inc:{"author.age":1}})
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "明代罗贯中",
"gender" : "男",
"age" : 100.0
}
}
db.sang_collect.update({name:"三国演义"},{$push:{comments:"好书666"}})
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "明代罗贯中",
"gender" : "男",
"age" : 100.0
},
"comments" : [
"好书666"
]
}
db.sang_collect.update({name:"三国演义"},{$push:{comments:"好书666啦啦啦啦"}})
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "明代罗贯中",
"gender" : "男",
"age" : 100.0
},
"comments" : [
"好书666",
"好书666啦啦啦啦"
]
}
db.sang_collect.update({name:"三国演义"},{$push:{comments:{$each:["111","222","333"]}}})
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "明代罗贯中",
"gender" : "男",
"age" : 100.0
},
"comments" : [
"好书666",
"好书666啦啦啦啦",
"111",
"222",
"333"
]
}
db.sang_collect.update({name:"三国演义"},{$push:{comments:{$each:["444","555"],$slice:-5}}})
{
"_id" : ObjectId("59f042cfcafd355da9486008"),
"name" : "三国演义",
"author" : {
"name" : "明代罗贯中",
"gender" : "男",
"age" : 100.0
},
"comments" : [
"111",
"222",
"333",
"444",
"555"
]
}
{
"_id" : ObjectId("59f07f3649fc5c9c2412a662"),
"class" : "三年级二班"
}
db.sang_collect.update({class:"三年级二班"},{$push:{students:{$each:[{name:"张一百",score:100},{name:"张九九",score:99},{name:"张九八",score:98}],$slice:5,$sort:{score:-1}}}})
{
"_id" : ObjectId("59f07f3649fc5c9c2412a662"),
"class" : "三年级二班",
"students" : [
{
"name" : "张一百",
"score" : 100.0
},
{
"name" : "张一百",
"score" : 100.0
},
{
"name" : "张九九",
"score" : 99.0
},
{
"name" : "张九九",
"score" : 99.0
},
{
"name" : "张九八",
"score" : 98.0
}
]
}
db.sang_collect.update({name:"三国演义"},{$addToSet:{comments:"好书"}})
db.sang_collect.update({name:"三国演义"},{$addToSet:{comments:{$each:["111","222","333"]}}})
db.sang_collect.update({name:"三国演义"},{$pop:{comments:1}})
db.sang_collect.update({name:"三国演义"},{$pull:{comments:"444"}})
db.sang_collect.update({name:"三国演义"},{$set:{"comments.0":"999"}})
db.sang_collect.update({comments:"333"},{$set:{"comments.$":"333-1"}})
db.sang_collect.save({x:111})
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有