appmetrics
appmetrics copied to clipboard
Mongo probe doesn't support promise interface
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' });
As mongoose thenable are not true promises, this may not work. https://mongoosejs.com/docs/queries.html
Fixed in v14 of Node https://github.com/nodejs/node/issues/22360#issuecomment-653199762