lts-stats-api/app/db/mongo/mongoPilots.js
2023-09-09 18:24:57 +02:00

20 lines
511 B
JavaScript

const { mongoExecute } = require("./mongoDBPool");
const colName = 'pilots_ref';
async function getUserFromReferenceTable(vid) {
return await mongoExecute(async({ collection }) => {
return await collection.findOne({ vid });
}, { colName });
}
async function getAllUsersFromReferenceTable() {
return await mongoExecute(async({ collection }) => {
return await collection.find({}).toArray();
}, { colName });
}
module.exports = {
getUserFromReferenceTable,
getAllUsersFromReferenceTable,
};