@羲凡——只为了更好的活着
mongoexport --authenticationDatabase admin --host 10.10.227.227 --port 30000 \
-q '{"channel":{ "$in":["210020","210032"]},"timestamp":{"$gte":1596696003149,"$lte":1596696003149}}' \
-u admin -p 123456 --db eventcenter --collection eventCenter \
--type json --out /opt/bigData/user/aaron/eventcenter.json
-------------------------以下是我的踩坑经历,有兴趣看没兴趣过-------------------------
-------------------------以下是我的踩坑经历,有兴趣看没兴趣过-------------------------
-------------------------以下是我的踩坑经历,有兴趣看没兴趣过-------------------------
mongo --host 10.10.227.227 --port 30000 -u admin -p 123456
db.eventCenter.find({channel:{ $in:["210020","210032"]},timestamp:{$gte:1596696003149,$lte:1596696003149}})
mongoexport --authenticationDatabase admin --host 10.10.227.227 --port 30000 \
-q {channel:{$in:["210020","210032"]},timestamp:{$gte:1596696003149,$lte:1596696003149}} \
-u admin -p 123456 --db eventcenter --collection eventCenter \
--type json --out /opt/bigData/user/aaron/eventcenter.json
2020-08-17T14:35:34.663+0800 too many positional arguments: [:[210020,210032]},timestamp::1596696003149 :[210020,210032]},timestamp::1596696003149]
2020-08-17T14:35:34.663+0800 try 'mongoexport --help' for more information
mongoexport --authenticationDatabase admin --host 10.10.227.227 --port 30000 \
-q {"channel":{ "$in":["210020","210032"]},"timestamp":{"$gte":1596696003149,"$lte":1596696003149}} \
-u admin -p 123456 --db eventcenter --collection eventCenter \
--type json --out /opt/bigData/user/aaron/eventcenter.json
2020-08-17T14:42:46.258+0800 too many positional arguments: [:[210020,210032]},timestamp::1596696003149} :[210020,210032]},timestamp::1596696003149}]
2020-08-17T14:42:46.258+0800 try 'mongoexport --help' for more information
mongoexport --authenticationDatabase admin --host 10.10.227.227 --port 30000 \
-q "{"channel":{ "$in":["210020","210032"]},"timestamp":{"$gte":1596696003149,"$lte":1596696003149}}" \
-u admin -p 123456 --db eventcenter --collection eventCenter \
--type json --out /opt/bigData/user/aaron/eventcenter.json
2020-08-17T14:47:19.597+0800 error validating settings: query '[123 99 104 97 110 110 101 108 58 123 32 58 91 50 49 48 48 50 48 44 50 49 48 48 51 50 93 125 44 116 105 109 101 115 116 97 109 112 58 123 58 49 53 5754 54 57 54 48 48 51 49 52 57 44 58 49 53 57 54 54 57 54 48 48 51 49 52 57 125 125]' is not valid JSON: invalid character ':' looking for beginning of object key string
2020-08-17T14:47:19.597+0800 try 'mongoexport --help' for more information
mongoexport --authenticationDatabase admin --host 10.10.227.227 --port 30000 \
-q "{'channel':{ '$in':['210020','210032']},'timestamp':{'$gte':1596696003149,'$lte':1596696003149}}" \
-u admin -p 123456 --db eventcenter --collection eventCenter \
--type json --out /opt/bigData/user/aaron/eventcenter.json
2020-08-17T14:48:16.013+0800 connected to: 10.10.227.227:30000
2020-08-17T14:48:16.021+0800 exported 0 records
.
.
.
mongoexport --authenticationDatabase admin --host 10.10.227.227 --port 30000 \
-q '{"channel":{ "$in":["210020","210032"]},"timestamp":{"$gte":1596696003149,"$lte":1596696003149}}' \
-u admin -p YumChina@123 --db eventcenter --collection eventCenter \
--type json --out /opt/bigData/user/aaron/eventcenter.json
2020-08-17T14:55:42.703+0800 connected to: 10.10.227.227:30000
2020-08-17T14:55:42.709+0800 exported 1 record
===================================================================
@羲凡——只为了更好的活着
若对博客中有任何问题,欢迎留言交流