MongoDB field problems and additions and deletions check operation
Delete a column of operations
Db. Riderreatimepositon.update ({},{$unset: {' createtime ': '}},false,true ')
Db. Riderreatimepositon.update ({},{$unset: {' Delete field ': '}},false,true ')
Add a new list of actions
Db. Riderreatimepositon.update ({},{$set: {' demo ': '}},false,true ')
Db. Riderreatimepositon.update ({},{$set: {' New field ': '}},false,true ')
MongoDB Solution: http://www.cnblogs.com/mengfanrong/p/5185908.html
Http://www.lai18.com/cate/99.html
Querying data
Db.testcol.find ()
Inserting data
Db. Riderposition.insert ({' name ': ' Jemm ', ' age ': ' + ', ' weight ': ' + ', ' createtime ': ' 2017-08-02 '})
Db. Riderposition.insert ({' name ': ' Jim ', ' age ': ' + ', ' weight ': ' 156 ', ' createtime ': ' 2017-08-02 15:25:20 '})
Db. Riderposition.find ()
Query by Time
Db. Riderposition.find (). Sort ({' Createtime ':-1})
MongoDB timed Tasks
Db. Riderposition.find ()
Db.log_event.insert ({' createat ': New Date (), ' logEvent ': 2, ' logmessage ': ' Success '})
Db.log_event.find ()
Db.log_event.createIndex ({' Expireat ': 1},{expireafterseconds:0})
Db.log_event.insert ({' expireat ': New Date (' August 2,2017 19:55:00 '), ' logEvent ': 2, ' logmessage ': ' Success '})
Getting Started with MongoDB three