mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
18 lines
416 B
JavaScript
18 lines
416 B
JavaScript
var path = require("path");
|
|
var mongojs = require("mongojs");
|
|
var db = require(pathThumbnails + "/handlers/db.js");
|
|
|
|
async function insert(collection, insertObject) {
|
|
return new Promise((resolve, reject) => {
|
|
db.collection(collection).insert(insertObject, function(err, docs) {
|
|
if (err) {
|
|
reject(err);
|
|
return;
|
|
}
|
|
resolve(docs);
|
|
});
|
|
});
|
|
}
|
|
|
|
module.exports.insert = insert;
|