|
# /usr/local/mongodb/bin/mongo --host 192.168.137.148
MongoDB shell version: 2.6.4
connecting to: 192.168.0.23:27017/test
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:
2014-09-24T14:16:58.169+0800 [initandlisten]
2014-09-24T14:16:58.169+0800 [initandlisten] ** WARNING: You are running on a NUMA machine.
2014-09-24T14:16:58.169+0800 [initandlisten] ** We suggest launching mongod like this to avoid performance problems:
2014-09-24T14:16:58.169+0800 [initandlisten] ** numactl --interleave=all mongod [other options]
2014-09-24T14:16:58.169+0800 [initandlisten]
> show dbs; #查看数据库
local1.203125GB
test0.203125GB
> use test1; #新建库
switched to db test1
> db.foo.save({"id":123456,"name":'zhangsan'}) #插入数据
> db.foo.find({"id":123456}) #查询数据
{ "_id" : ObjectId("542277078091089e1cbfecbc"), "id" : 123456, "name" : "zhangsan" }
> show dbs;
local1.203125GB
test0.203125GB
test10.203125GB
|
|
|