码迷,mamicode.com
首页 > 数据库 > 详细

MongoDB随笔

时间:2017-04-24 21:15:54      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:等于   create   port   csv   随笔   div   大于   nbsp   roles   

创建用户
db.createUser({user: "abc",pwd: "abc123",roles: [ { role: "readWrite", db: "test" } ]});
db.system.users.remove({user:"abc"})
 
MongoDB导出数据
mongoexport -d service -c speech -o file --type csv -f id,time
mongoexport -d service -c speech -o file --type json -f id,time
 
mongoexport -d service -c speech -o file.json --type json -f id,time -q ‘{"time": {$gt:1483200000000}}‘ #大于等于2017年
mongoexport -d service -c speech -o file.csv --type csv -f id,time -q ‘{"time": {$gt:1483200000000}}‘ #大于等于2017年
 
待续。。。

MongoDB随笔

标签:等于   create   port   csv   随笔   div   大于   nbsp   roles   

原文地址:http://www.cnblogs.com/zhzhang/p/6758846.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!