You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constructor(env: any) {
this.env = env;
}
// Generic method to return a collection of a specific type
collection<T>(): MongoDBAPI<T> {
return new MongoDBAPI<T>(this.env);
}
}
// Create a MongoConnection instance
const connection = new MongoConnection(env);
// Get the collections
const taskCollection = connection.collection();
const taskItemCollection = connection.collection();
class MongoConnection {
private env: any;
}
// Create a MongoConnection instance
const connection = new MongoConnection(env);
// Get the collections
const taskCollection = connection.collection();
const taskItemCollection = connection.collection();
const task = await taskCollection.findOne({ status: { $eq: "complete" } });
console.log("Found task:", task);
const taskItem = await taskItemCollection.findOne({ status: { $eq: "complete" } });
console.log("Found taskItem :", taskItem );
The text was updated successfully, but these errors were encountered: