mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Updating to have type always
This commit is contained in:
15
server/apps/addtype.js
Normal file
15
server/apps/addtype.js
Normal file
@@ -0,0 +1,15 @@
|
||||
path = require('path'),
|
||||
pathThumbnails = __dirname;
|
||||
db = require(pathThumbnails + '/../handlers/db.js');
|
||||
|
||||
db.getCollectionNames(function(err, docs) {
|
||||
for(var i = 0; i < docs.length; i++) {
|
||||
addType(docs[i]);
|
||||
}
|
||||
})
|
||||
|
||||
function addType(name) {
|
||||
db.collection(name).update({duration: {$exists: true},type:{$ne:"suggested"}}, {$set: { type: "video" }}, {multi: true}, function(err, doc) {
|
||||
process.exit();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user