mongoDB ???????
???????????? ???????[ 2016/10/25 10:05:31 ] ????????????? mongoDB
????> db.users.find({"favorites.artist": "Picasso"}??
????... {finished:0??points:0??badges:0}).pretty()
????//???favorites.artist??Pisanello?????
????> db.users.find({"favorites.artist": "Pisanello"}??
????... {finished:0??points:0??badges:0}).pretty()
????{
????"_id" : 1??
????"name" : "sue"??
????"age" : 19?? //Author : Leshami
????"type" : 3?? //Blog : http://blog.csdn.net/leshami
????"status" : "P"??
????"favorites" : {
????"artist" : "Pisanello"??
????"food" : "pie"
????}??
????"lastModified" : ISODate("2016-09-30T08:00:47.826Z")
????}
????{
????"_id" : 6??
????"name" : "abc"??
????"age" : 43??
????"type" : 3??
????"status" : "A"??
????"favorites" : {
????"food" : "pizza"??
????"artist" : "Pisanello"
????}??
????"lastModified" : ISODate("2016-09-30T08:00:47.826Z")
????}
????3??db.collection.update()
????//???????db.collection.update()???????
????> db.users.update(
????... { "favorites.artist": "Pisanello" }??
????... {
????... $set: { "favorites.food": "pizza"?? type: 0?? }??
????... $currentDate: { lastModified: true }
????... }
????... ) //??????????????У?nMatched?????????nModified?1?????????????????????
????WriteResult({ "nMatched" : 1?? "nUpserted" : 0?? "nModified" : 1 }) //?????updateOne????
????> db.users.update(
????... { "favorites.artist": "Pisanello" }??
????... {
????... $set: { "favorites.food": "pizza"?? type: 0?? }??
????... $currentDate: { lastModified: true }
????... }??
????... { multi: true } //??ò???multi??????true
????... ) //???????????????????????2?????????????????????????????
????WriteResult({ "nMatched" : 2?? "nUpserted" : 0?? "nModified" : 2 }) //?????updateMany????
????//?????????????
????> db.users.find({"favorites.artist": "Pisanello"}??
????... {finished:0??points:0??badges:0}).pretty()
????{
????"_id" : 1??
????"name" : "sue"??
????"age" : 19??
????"type" : 0??
????"status" : "P"??
????"favorites" : {
????"artist" : "Pisanello"??
????"food" : "pizza"
????}??
????"lastModified" : ISODate("2016-09-30T09:31:10.524Z")
????}
????{
????"_id" : 6??
????"name" : "abc"??
????"age" : 43??
????"type" : 0??
????"status" : "A"??
????"favorites" : {
????"food" : "pizza"??
????"artist" : "Pisanello"
????}??
????"lastModified" : ISODate("2016-09-30T09:31:10.524Z")
????}
????4??db.collection.replaceOne()
????//?滻??????????(name:"abc")
????> db.users.find({name:"abc"}??{finished:0??points:0??badges:0}).pretty()
????{
????"_id" : 6??
????"name" : "abc"??
????"age" : 43??
????"type" : 1??
????"status" : "A"??
????"favorites" : {
????"food" : "pizza"??
????"artist" : "Picasso"
????}
????}
????//???????db.collection.replaceOne()?滻??????abc??????????滻?????????
????> db.users.replaceOne(
????... { name: "abc" }??
????... { name: "amy"?? age: 34?? type: 2?? status: "P"?? favorites: { "artist": "Dali"?? food: "donuts" } }
????... )
????{ "acknowledged" : true?? "matchedCount" : 1?? "modifiedCount" : 1 } //????????????????????????
????//????滻?????
????> db.users.find({name:"amy"}??{finished:0??points:0??badges:0}).pretty()
????{
????"_id" : 6??
????"name" : "amy"??
????"age" : 34??
????"type" : 2??
????"status" : "P"??
????"favorites" : {
????"artist" : "Dali"??
????"food" : "donuts"
????}
????}
????//???db.collection.update???????????????Ч??
????> db.users.update(
????... { name: "xyz" }??
????... { name: "mee"?? age: 25?? type: 1?? status: "A"?? favorites: { "artist": "Matisse"?? food: "mango" } }
????... )
????WriteResult({ "nMatched" : 1?? "nUpserted" : 0?? "nModified" : 1 })
????????С??
????1??mongoDB????????к??????????????????update?????3.2?汾????updateOne??updateMany
????2??mongoDB????滻??к??????????????????update?????3.2?汾????replaceOnye??replaceMany
????3??updateOne??updateMany???update???????????update???????????multi??true??false???????updateMany???updateOne
????4??replaceOne??replaceMany????update???????????update???????????multi??true??false???????replaceMany???replaceOne
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
?????????????????????????Щ????????????????????TC???????????????Щ???????????????????????????????????????????????(java .net ?????)???mysql???????????????????ж????д???Python???????????????(DB2)??????BufferPool????????????????????????????????6??????????????????滮???????????????-????????SQL Server???????????????????λ?????PHP??SQL????????????????????Pythonд???NoSQL????????? SQL ?е????????????? SQL ?е?????????Java???????:?????MySQL???????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????