7 lines
No EOL
429 B
JavaScript
7 lines
No EOL
429 B
JavaScript
var db = connect("192.168.0.1:27017/lastlogin");
|
|
//var conn = new Mongo("192.168.0.1");
|
|
//var db = conn.getDB("lastlogin");
|
|
var dd = function(x) { if(x==0){x++}; var s = x.toString(); if(s.length > 1){return s;} else { return "0"+s;}}
|
|
var now = new Date();
|
|
var col = now.getFullYear() + dd(now.getMonth()) + dd(now.getDate())
|
|
db.getCollection("ll_"+col.slice(2)).createIndexes([{"date": 1},{"country": 1},{"user": 1,"date": -1}]) |