20 lines
511 B
JavaScript
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,
|
|
}; |