sonyet 发表于 2018-10-25 08:29:36

mac下mongodb的安装和使用(终端操作)

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
  
2017-07-23T18:30:19.645+0800 I CONTROL ** WARNING: Access control is not enabled for the database.
  
2017-07-23T18:30:19.645+0800 I CONTROL **          Read and write access to data and configuration is unrestricted.
  
2017-07-23T18:30:19.645+0800 I CONTROL
  
2017-07-23T18:30:19.645+0800 I CONTROL
  
2017-07-23T18:30:19.645+0800 I CONTROL ** 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-db0.000GB
  
> exit
  
bye


页: [1]
查看完整版本: mac下mongodb的安装和使用(终端操作)