Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query documentation still suggests unsupported method #13401

Closed
2 tasks done
oldshaghat opened this issue May 14, 2023 · 0 comments · Fixed by #13433
Closed
2 tasks done

Query documentation still suggests unsupported method #13401

oldshaghat opened this issue May 14, 2023 · 0 comments · Fixed by #13433
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone

Comments

@oldshaghat
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

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

@vkarpov15 vkarpov15 added this to the 7.1.3 milestone May 16, 2023
@vkarpov15 vkarpov15 added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label May 16, 2023
@vkarpov15 vkarpov15 modified the milestones: 7.2.2, 7.2.1 May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants