error: Uncaught (in promise) AssertionError #12377
-
I am a new Deno learner, I tried a tutorial code that uses MongoDB but I got the following error:
As the project has many files, Let me know if is it needed to add some parts of project codes here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please stop opening issues for general usage questions. Either join the Discord forum or limit your questions to the Q&A section of the discussion forum. |
Beta Was this translation helpful? Give feedback.
-
You should connect the const client = new MongoClient();
await client.connect("mongodb://localhost:27017");
// now client is connected, you can use it
const db = client.database("test");
const users = db.collection<UserSchema>("users"); Please open a discussion or issue in https://github.com/denodrivers/deno_mongo if you still have problems |
Beta Was this translation helpful? Give feedback.
You should connect the
MongoClient
before using its methods:Please open a discussion or issue in https://github.com/denodrivers/deno_mongo if you still have problems