share: provide collection api fix#2
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Artem Anufrij
2023-02-17 10:21:58 +01:00
parent 3b91eddcdd
commit 5f9d438420
3 changed files with 25 additions and 6 deletions

View File

@@ -42,6 +42,15 @@ exports.byId = function (id, callback) {
});
}
exports.collection = function (callback) {
dbo.collection("shares")
.find({})
.toArray((err, result) => {
if (err) throw err;
cb(callback, result);
});
}
exports.exists = function (object_id, callback) {
dbo.collection("shares")
.findOne({ object_id: ObjectId(object_id) })