const { getMongoConnection } = require("./mongoDBPool"); const { MONGO_DB, } = process.env; const DB = MONGO_DB || 'lts'; async function getUserFromReferenceTable(vid) { const conn = await getMongoConnection(); try { const db = conn.db(DB); const col = db.collection('pilots_ref'); const user = await col.findOne({ vid }, {}); return user; } catch (err) { console.error(err); } finally { await conn.close(); } } module.exports = { getUserFromReferenceTable };