-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Expose mongoose.Query._pre as public #9784
Labels
new feature
This change adds new functionality, like a new method or class
Milestone
Comments
looks like I can just patch |
This is something we've been wanting to do for a while. We will look into this for our next minor release. |
IslandRhythms
added
the
new feature
This change adds new functionality, like a new method or class
label
Jan 28, 2021
vkarpov15
added a commit
that referenced
this issue
Mar 4, 2021
This was referenced Mar 11, 2021
Closed
This was referenced Mar 13, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
feature
What is the current behavior
mongoose.Query._pre
undocumented and privateWhat is the expected behavior?
mongoose.Query._pre
documented and publicWhy?
I’m an author of casl (permission management system) and I wrote a plugin for mongoose which adds
accessibleBy
static method to model. This method returns accessible records from db based on user permissions.There are cases when I can predict that there is no such records in db and instead of sending dummy query that returns no results, I’d like to throw an error that user doesn’t have permissions.
I can use pre exec hook on query to achieve this but currently it’s private and I don’t want to use private method which eventually may disappear without any notice in release
The text was updated successfully, but these errors were encountered: