Big data class records

MongoDB

sudo service mongodb start

pgrep mongo - l
 978 mongod

mongo
MongoDB shell version: 2.6.10
connecting to: test

show dbs
School  0.078GB
admin   (empty)
local   0.078GB

use School
switched to db School

show collections
system.indexes
> db.createCollection('teacher')
{ "ok" : 1 }

> db.createCollection('student')
{ "ok" : 1 }

> db.student.insert({_id:1, sname: 'zhangsan', sage: 20})
WriteResult({ "nInserted" : 1 })

> db.student.save({_id:1, sname: 'zhangsan', sage: 22})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324866157&siteId=291194637