Mongoose promises documentation says queries are not promises?

后端 未结 3 564
庸人自扰
庸人自扰 2020-12-10 19:11

From the docs (Mongoose v5.4.1, latest version):

Mongoose async operations, like .save() and queries, return thenables. This

3条回答
  •  时光说笑
    2020-12-10 19:44

    They are "promise like", which means you can await them and call .then() and .catch() on them, however they are not instanceof Promise.

提交回复
热议问题