You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(node:7142) UnhandledPromiseRejectionWarning: MongoInvalidArgumentError: Method "collection.find()" accepts at most two arguments
at Collection.find (/Users/nwongsavit/Projects/fso/part3/phonebook/node_modules/mongodb/lib/collection.js:238:19)
at NativeCollection.<computed> [as find] (/Users/nwongsavit/Projects/fso/part3/phonebook/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:191:33)
at NativeCollection.Collection.doQueue (/Users/nwongsavit/Projects/fso/part3/phonebook/node_modules/mongoose/lib/collection.js:135:23)
at /Users/nwongsavit/Projects/fso/part3/phonebook/node_modules/mongoose/lib/collection.js:82:24
at processTicksAndRejections (internal/process/task_queues.js:75:11)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7142) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async functionwithout a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7142) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
What is the expected behavior?
Should be able to chain .then() to Model.find() without an error.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: v14.15.4
Mongoose: 6.0.2
MongoDB: 4.1.1
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Model.find().then()
results inMongoInvalidArgumentError: Method "collection.find()" accepts at most two arguments
.If the current behavior is a bug, please provide the steps to reproduce.
Model.find()
with.then()
MongoInvalidArgumentError
oncollection.find()
Code:
Error:
What is the expected behavior?
Should be able to chain
.then()
toModel.find()
without an error.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: v14.15.4
Mongoose: 6.0.2
MongoDB: 4.1.1
The text was updated successfully, but these errors were encountered: