文章不在长,坚持不懈记录下努力前行的脚步
发布时间:2016-10-10 14:31:38
备份mongodump -hlocalhost -dmydb -cusers -q '{status:"A"}' -o /root/backup集合数据> db.users.find({status:"A"}){ "_id" : 2, "name" : "bob", "age" : 42, "type" : 1, "status" : "A", "favorites" : { "artist" : "Miro", "food" : "meringue" }, "finished" : [ 11, 25 ], "badges" : [ "green" ], "points" .........【阅读全文】
发布时间:2016-10-09 16:55:00
创建数据库和集合use mynewdbdb.mynewcollection.insert({name:larry,age:18})2016-09-04T14:37:56.757+0800 ReferenceError: larry is not defined字符串应该用引号包起来db.mynewcollection.insert({name:'larry',age:18})这样就创建了mynewdb数据库和mynewcollection集合CRUD操作1.create操作db.collection.in.........【阅读全文】
发布时间:2016-10-09 15:58:03
一、配置yum源vi /etc/yum.repos.d/mongodb-org-2.6.repo[mongodb-org-2.6]name=MongoDB 2.6 Repositorybaseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/gpgcheck=0enabled=1二、安装yum install -y mongodb-org三、启动mongodservice mongod start===============service mongod stops.........【阅读全文】