executionStats:带有nodejs和mongoose的DocumentDB
我无法使用Mongoose和nodejs从DocumentDB获得executionStats
。
await model.find({ order_id: payload.order_id })
.sort({ updated_at: -1 })
.limit(1)
.explain('executionStats')
同一命令从蒙古
起作用,并返回执行时间。 但是,当我们尝试使用Mongoose时,我会遇到此错误:
MongoServerError: Field 'verbosity: allPlansExecution' is currently not supported
at MessageStream.messageHandler (/my-project/node_modules/mongoose/node_modules/mongodb/src/cmap/connection.ts:753:20)
at MessageStream.emit (events.js:314:20)
at MessageStream.EventEmitter.emit (domain.js:483:12)
我需要一个内置的数据库进程来计算从Nodejs执行查询所花费的时间。但是上述过程不起作用。
关于如何实现这一目标或处理上述错误有任何想法吗?
I'm unable to get executionStats
from DocumentDB using mongoose and NodeJS.
await model.find({ order_id: payload.order_id })
.sort({ updated_at: -1 })
.limit(1)
.explain('executionStats')
The same command works from mongosh
and returns the execution time taken.
But when we try using mongoose, I'm getting this error:
MongoServerError: Field 'verbosity: allPlansExecution' is currently not supported
at MessageStream.messageHandler (/my-project/node_modules/mongoose/node_modules/mongodb/src/cmap/connection.ts:753:20)
at MessageStream.emit (events.js:314:20)
at MessageStream.EventEmitter.emit (domain.js:483:12)
I need a built-in Database process to calculate the time taken to execute a query from NodeJS. But the above process isn't working.
Any idea on how to achieve this or to handle the above error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论