Open fmoessle opened 1 year ago
This should also be implemented for create
and patch
.
See also: https://github.com/feathersjs-ecosystem/feathers-mongodb/issues/219
@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;
};
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?