Skip to content

error: Uncaught (in promise) AssertionError #12377

Answered by erfanium
goodmanworld asked this question in Q&A
Discussion options

You must be logged in to vote

You should connect the MongoClient before using its methods:

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

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kitsonk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #12376 on October 08, 2021 22:54.