沈斌
2018-02-02 aaa0e764f454029651ebfa978d3ea5b42b16a6a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * Created by bin.shen on 7/6/16.
 */
 
var moment = require('moment');
var mongoClient = require('mongodb').MongoClient;
var config = require('./config');
var method = require('./method');
 
mongoClient.connect(config.URL, function(err, db) {
    if (err) return;
    console.log('Connecting to Mongo DB at ' + config.URL);
 
    // method.getSort(db, 5064, function (doc) {
    //     if(doc != null) {
    //         console.log(doc['total']);
    //     }
    //     db.close();
    // });
 
    method.createSort(db, function(docs){
        console.log(docs)
        db.close();
    });
});