-
Notifications
You must be signed in to change notification settings - Fork 96
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
How to make .remove(null) not to return all removed documents #439
Comments
This should also be implemented for |
@fmoessle The best way to avoid this until the library is updated is to use an after hook to unset the results. For example // I wouldn't use $limit: 0 just yet. That may cause patch/remove to not
// actually update any records? I know your example says it works and that is
// good, but I am not sure thats the case for patch too? So I wrote this to use
// $returning similar to feathers-sequelize until we can ensure $limit: 0 is
// correct.
const handleMulti = (context) => {
const { id, params } = context;
if (id) {
return context;
}
// if (params && params.query && params.query.$limit === 0) {
// context.result = [];
// }
if (params && params.query && params.query.$returning === false) {
context.result = [];
}
return context;
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MongoDB: 4.2.17
feathers-mongoose: 8.5.1
@feathers/feathers: 4.5.15
Hi!
Currently calling .remove(null) on a service returns all removed documents.
While this is fine for a small number of removed documents, when the number get's higher (in our case 50k+)
things start to get very slow.
Is there a way to avoid this?
The text was updated successfully, but these errors were encountered: