lts-stats-api/app/db/mongo/mongoPilots.js

20 lines
511 B
JavaScript
Raw Normal View History

2023-09-09 18:24:57 +02:00
const { mongoExecute } = require("./mongoDBPool");
2023-01-06 00:58:55 +01:00
2023-09-09 18:24:57 +02:00
const colName = 'pilots_ref';
2023-01-06 00:58:55 +01:00
async function getUserFromReferenceTable(vid) {
2023-09-09 18:24:57 +02:00
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 });
2023-01-06 00:58:55 +01:00
}
module.exports = {
2023-09-09 18:24:57 +02:00
getUserFromReferenceTable,
getAllUsersFromReferenceTable,
2023-01-06 00:58:55 +01:00
};