命令行
mongoimport -d mydb2 -c test --type json --file /home/example/person.json
代码文件
echo "
db.test.find({hobbies:{\$all:['唱歌','跳舞']}}).sort({_id:1});
db.test.find({hobbies:{\$all:['羽毛球','跳舞']}}).sort({_id:1});
db.test.find({hobbies:{\$size:3}}).sort({_id:1});
db.test.find({hobbies:{\$exists:true}}).sort({_id:1});
db.test.find({age:{\$in:[19,23]}}).sort({_id:1});
db.test.find({age:{\$nin:[20]}}).sort({_id:1});
db.test.find({age:{\$mod:[9,2]}}).sort({_id:1});
"