|
macdeMacBook-Pro:~ mac$ sudo mongo
Password:
MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.4
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2017-07-23T18:30:19.645+0800 I CONTROL [initandlisten]
2017-07-23T18:30:19.645+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-07-23T18:30:19.645+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-07-23T18:30:19.645+0800 I CONTROL [initandlisten]
2017-07-23T18:30:19.645+0800 I CONTROL [initandlisten]
2017-07-23T18:30:19.645+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
> db
test
> use mongo1-db
switched to db mongo1-db
> db.user.insert({userid:"admin",password:"123456"})
WriteResult({ "nInserted" : 1 })
> db.user.find()
{ "_id" : ObjectId("59747ba6f6a0adee8c9d5fdb"), "userid" : "admin", "password" : "123456" }
> show dbs
admin 0.000GB
local 0.000GB
mongo1-db 0.000GB
> exit
bye
|
|
|