MongoDB Configuration Local Boot
C:\mongodb\bin>mongod.exe--dbpath "c:\\mongodb\data\db"--logpath "c:\\mongodb\
Data\log\mongodb.log "
C:\USERS\JIANGCHUNMING>CD C:\MongoDB\bin
C:\mongodb\bin>mongo.exe--port 27017
MongoDB insertion Time
> Db.orders.insert ({id:104,title: "Yuiyuig", Price:18.9,addtime:new Date (2017,0,31
, 12,01,00)})
Deleting a database
Querying the database
MongoDB Modify Data
{"_id": ObjectId ("5901a40981f45b10993c9d58"), "id": 1101, "name": "Person",
' Age ': 222, ' address ': ' China '}
> Db.user.insert ({id:1101,name:test})
2017-04-27t16:22:31.997+0800 E QUERY [Thread1] referenceerror:test is not de
Fined:
@ (Shell): 1:25
> Db.user.insert ({id:1101,name: "Test"})
Writeresult ({"ninserted": 1})
> Db.user.find ()
{"_id": ObjectId ("5901aa5081f45b10993c9d59"), "id": 1101, "name": "Test"}
> Db.user.insert ({id:1102,name: "Dest"})
Writeresult ({"ninserted": 1})
> Db.user.find ()
{"_id": ObjectId ("5901aa5081f45b10993c9d59"), "id": 1101, "name": "Test"}
{"_id": ObjectId ("5901aa6681f45b10993c9d5a"), "id": 1102, "name": "Dest"}
MongoDB Modify Data Operation *********************************************
Modify ID
> var model = db.user.findOne ({"Name": "Test"})
> model.id=1103
1103
> db.user.update ({"Name": "Test"},model)
Writeresult ({"nmatched": 1, "nupserted": 0, "nmodified": 1})
> Db.user.find ()
{"_id": ObjectId ("5901aa5081f45b10993c9d59"), "id": 1103, "name": "Test"}
{"_id": ObjectId ("5901aa6681f45b10993c9d5a"), "id": 1102, "name": "Dest"}
>
MongoDB Modify Data Operation *********************************************
Https://git.oschina.net/lookingdreamer/RexDeploy_v1
*************************************************************************************************************** ****
MongoDB Insert Time Note
>db.orders.insert ({id:104,title: "Yuiyuig", Price:18.9,addtime:new Date (2017,0,31
, 12,01,00)})
Insert Current time:
> Db.orders.insert ({id:104,title: "Yuiyuig", Price:18,addtime:new Date ()})
Writeresult ({"ninserted": 1})
http://xiaorui.cc/2014/05/01/mongodb%E7%9A%84%E6%97%A5%E6%9C%9F%E6%97%B6%E9%97%B4%E7%9A%84%E6%8F%92%E5%85%A5% e5%8f%8a%e6%9f%a5%e8%af%a2/
Insert Current time:
> Db.orders.insert ({id:104,title: "Yuiyuig", Price:18,addtime:new Date (). tolocales
Tring ()})
Deleting a database
Show DBS--Display database
Db.dropdatabase ()--delete database
D:\MongoCTest\RiderPosition
D:\Projects\OTS\ExFresh.OTS\1. presentation\1.2 Api\contract\o2omanager
Getting Started with MongoDB II