mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
19 lines
467 B
JavaScript
19 lines
467 B
JavaScript
var path = require("path");
|
|
var mongojs = require("mongojs");
|
|
var db = require(pathThumbnails + "/handlers/db.js");
|
|
var update = require(pathThumbnails + "/handlers/dbFunctions/update.js");
|
|
|
|
function incrementList(collection, way) {
|
|
return update(
|
|
collection,
|
|
{ _id: coll, count: { $gt: 0 } },
|
|
{
|
|
$inc: { count: way },
|
|
$set: { accessed: Functions.get_time() }
|
|
},
|
|
{ upsert: true }
|
|
);
|
|
}
|
|
|
|
module.exports.incrementList = incrementList;
|