Query documentation still suggests unsupported method #13401
Labels
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone
Prerequisites
Mongoose version
7.1.0
Node.js version
18.8.0
MongoDB server version
1.36.3
Typescript version (if applicable)
No response
Description
The mongoose documentation page for queries still suggests that a callback function is supported for queries (such as Model.findOne) but other information suggests that these have been deprecated since 5.0 and in testing this 7.1 application they appear to not be supported at all; if that's actually correct the queries page should be updated (or if this is still allowed, maybe an updated example?)
Steps to Reproduce
Create a model;
Attempt an 'old style' query : MyModel.findOne({ 'myfield' : fieldVal}, function(error, result) { //do stuff });
Observe MongooseError: Model.findOne() no longer accepts a callback
at Function.findOne
Expected Behavior
Documentation matches implementation
The text was updated successfully, but these errors were encountered: