There is a need to work, to assist in extracting a data system cashloandb
MongoDB Collection involved: Cardbill (time period 6.1-8.28), Cardreport (time period 2.1-8.28)
If you do not support time-based extraction, you can extract full-volume data.
To enter the database using the MONGO client command:
Jsfkrs0:primary> Show DBS;
2018-09-04t17:35:57.692+0800 E QUERY [thread1] error:listdatabases failed:{
"OK": 0,
"ErrMsg": "Not authorized in Admin to execute command {listdatabases:1.0}",
"Code": 13,
"codename": "Unauthorized"
}:br/>[email protected]/mongo/shell/utils.js:25:13
[Email protected]/mongo/shell/mongo.js:62:1br/>[email protected]/mongo/shell/utils.js:769:19
[Email protected]/mongo/shell/utils.js:659:15br/>@ (SHELLHELP2): 1:1
jsfkrs0:primary> Use admin
Switched to DB admin
Jsfkrs0:primary> Db.auth (' mangoadmin ', ' password ')</span></span>
1
Jsfkrs0:primary> Show DBS;
Admin 0.000GB
Cashloandb 96.287GB
Fuf_mgdb 0.765GB
Local 1.280GB
Switch to the DB we want to manipulate
Jsfkrs0:primary> Use Cashloandb
Switched to DB cashloandb
Take a look at the full amount of data for these two sets.
Jsfkrs0:primary> Db.cardBill.count ();
247126
Jsfkrs0:primary> Db.cardReport.count ();
249128
Let's see if there's time in this table. We take a piece of data to see, if there is, we can be based on this timestamp to export work;
Jsfkrs0:primary> Db.cardBill.findOne ();
{
"_id": ObjectId ("59e180110cxxxxxx"),
"Timestamp": Numberlong ("1507950609625"),
"TaskId": "Xxxxxx-b08d-11e7-bf17-xxxxx",
"Bill": "[{\" balance\ ": 47000.00,\" deposits\ ": [],\" Bills\ ": [{\" installments\ ": [],\" bill_id\ ": \" D81f1e60-a02d-11e7-a63a-00163e0dfac7\ ", \" bill_type\ ": \" done\ ", \" bank_name\ ": \" Citic bank \ ", \" bill_month\ ": \" 2017-04\ ", \" bill_date\ ": \" 2017-04-14\ ", \" Payment_due
This timestamp has 13 bits, accurate to milliseconds, we need to convert to UNIX timestamp when exporting, and also accurate to milliseconds.
Http://tool.chinaz.com/Tools/unixtime.aspx
The normal conversion comes only to the second bit, only 10 bits. Can be directly after the conversion of the UNIX timestamp 000, or the conversion of the time directly to the millisecond, down we can use the MANGODB Export tool to export;
mongoexport-d cashloandb-c cardbill-uadmin-ppassword--authenticationdatabase "admin"-Q ' {"timestamp": {$gte: Numberlong ("1517414400000"), $lte: Numberlong ("1535472000000")}} '-O Cardbill.json
MongoDB time stamp-based derivative operation