dump import mongodb without mongodump
1, dump.js {}{} 前边括号是条件, 后边括号筛选输出
var c = db.ws5f1171ae8e32c7098cbbfd1a.find({ status: 1 },{"rowid":1,"rc5f1179e58e32c7098cbc0042":1,_id:0}) while(c.hasNext()) { printjson(c.next()); }
2, mongo 127.0.0.1:27017/test dump.js
3,mongoimport
mongoimport --db huzh --collection col_huzh --file result_ptable.log
# 导入文件内容
uos@uos-pc:~$ cat result_ptable.log
{
"rowid" : "29dbc62d-4da0-4c81-8988-9d4fa17180c9",
"5f1171ae8e32c7098cbbfcda" : "TEXT",
"rc5f1176108e32c7098cbc0037" : [ ]
}
{
"rowid" : "228a06c5-6be6-4e3b-8430-2964f1139c48",
"5f1171ae8e32c7098cbbfcda" : "TEXT",
"rc5f1176108e32c7098cbc0037" : [ ]
}