-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
findById(..).accessibleBy(..)
returns an array instead of a document
#87
Comments
This is a bug. Just reverse the order of calls. I will fix this tomorrow. Thanks for the issue! |
🎉 This issue has been resolved in version 2.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 2.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 0.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 0.4.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 0.7.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@stalniy console.log('find', ArticleModel.accessibleBy(ability).find);
console.log('findOne', ArticleModel.accessibleBy(ability).findOne);
console.log('findById', ArticleModel.accessibleBy(ability).findById);
TypeError: ArticleModel.accessibleBy(...).findById is not a function |
|
Method is still there console.log('1', ArticleModel.findById('test').accessibleBy(ability).getQuery());
console.log('2', ArticleModel.accessibleBy(ability).findById('test').getQuery()); Output:
|
There are 2 types of methods:
What you need to check is |
When
accessibleBy
is appended to afindById
query, the resulting query is a single-object array instead of returning the object itselfThe text was updated successfully, but these errors were encountered: