import { connectToIFSINTDatabase } from './mongodb_helpers.ts'
export async function main(key: string) {
// the key should be a string formatted as such: yyyyMMdd-OH01 where OH is 2 digit state code and 01 is workstation number
const client = await connectToIFSINTDatabase()
try {
const messagesCollection = client.database("IFSINT").collection("messages");
const messages = await messagesCollection.find({debugKey: key}).toArray()
console.log(messages)
// const all_users = await users.find({ username: { $ne: null } }).toArray();
return
} catch (error) {
console.error("Error:", error);
} finally {
await client.close();
}
}
import { connectToIFSINTDatabase } from './mongodb_helpers.ts'
export async function main(key: string) {
// the key should be a string formatted as such: yyyyMMdd-OH01 where OH is 2 digit state code and 01 is workstation number
const client = await connectToIFSINTDatabase()
try {
const messagesCollection = client.database("IFSINT").collection("messages");
const messages = await messagesCollection.find({debugKey: key}).toArray()
console.log(messages)
// const all_users = await users.find({ username: { $ne: null } }).toArray();
return
} catch (error) {
console.error("Error:", error);
} finally {
await client.close();
}
}