DB Models for Image, Album, based on Data

This commit is contained in:
tmshv committed 2017-05-25 21:48:11 +03:00
1 parent b829885b00
commit b69c19239e
5 files changed
+106 -16

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
async function find(collection, query, {sort, skip, limit}) {
const cursor = collection.find(query)
if (sort) cursor.sort(sort)
if (skip) cursor.skip(skip)
if (limit) cursor.limit(limit)
return cursor.toArray()
}
async function findOne(collection, query) {
return collection.findOne(query)
}
exports.find = find
exports.findOne = findOne