added
This commit is contained in:
parent
a2fc00df74
commit
2d3d9e43d3
1 changed files with 34 additions and 0 deletions
34
mongo_scripts.txt
Normal file
34
mongo_scripts.txt
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
################
|
||||
var dd = function(x) { var s = x.toString(); if(s.length > 1){return s;} else { return "0"+s;}}
|
||||
|
||||
for (var i=1; i<18; i++) {
|
||||
var col = "ll_1806"+dd(i);
|
||||
print(col);
|
||||
db.getCollection(col).createIndex({date: -1}, {expireAfterSeconds: 15552000, name: "expire", background: true});
|
||||
}
|
||||
|
||||
###########
|
||||
var dd = function(x) { var s = x.toString(); if(s.length > 1){return s;} else { return "0"+s;}}
|
||||
|
||||
for (var m=1; m<=12; m++) {
|
||||
for (var d=1; d<=31; d++) {
|
||||
var col = "ll_15"+dd(m)+dd(d);
|
||||
if (db.getCollection(col).exists != null) {
|
||||
print(col);
|
||||
print(db.getCollection(col).totalSize());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
####
|
||||
var ar = db.getCollectionNames()
|
||||
var len = ar.length
|
||||
|
||||
for (var i=0; i<len; i++) { if (ar[i].startsWith("ll")) { print(db.getCollection(ar[i]))}}
|
||||
|
||||
|
||||
####
|
||||
db.lastlogin_1703.createIndex({date: -1}, {expireAfterSeconds: 15552000, name: "expire", background: true})
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue