Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongo probe doesn't support promise interface #632

Open
smeijer opened this issue Dec 6, 2019 · 1 comment
Open

Mongo probe doesn't support promise interface #632

smeijer opened this issue Dec 6, 2019 · 1 comment

Comments

@smeijer
Copy link

smeijer commented Dec 6, 2019

The mongo probe doesn't report anything when using the promise interface:

supported

db.comments.find({ blogId: 'x' }).toArray(console.log);

unsupported

db.comments.find({ blogId: 'x' }).toArray().then(console.log);

Thereby also unsupported

const comments = await db.comments.find({ blogId: 'x' }).toArray();

I use the find method here as an example, but the same is true for the other operations.

const comment = await db.comments.findOne({ id: 'x' });
@AbhishekPathania
Copy link

As mongoose thenable are not true promises, this may not work.
https://mongoosejs.com/docs/queries.html

Fixed in v14 of Node
nodejs/node#22360 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants