mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Delete rewrite.js
This commit is contained in:
committed by
GitHub
parent
a499fa9001
commit
498e8e4676
@@ -1,23 +0,0 @@
|
||||
path = require('path'),
|
||||
pathThumbnails = __dirname;
|
||||
db = require(pathThumbnails + '/../handlers/db.js');
|
||||
|
||||
db.getCollectionNames(function(err, docs) {
|
||||
for(var i = 0; i < docs.length; i++) {
|
||||
makeNewAndDelete(docs[i]);
|
||||
}
|
||||
})
|
||||
|
||||
function makeNewAndDelete(name) {
|
||||
db.collection(name).find({views: {$exists: true}}, function(err, doc) {
|
||||
if(doc.length == 0) {
|
||||
} else if(doc.length == 1) {
|
||||
db.collection(name + "_settings").insert(doc[0], function(err, result){
|
||||
console.log("Result insert", result);
|
||||
db.collection(name).remove({views: {$exists: true}}, function(err, result_del) {
|
||||
console.log("Result delete", result_del);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user