loopbackio / loopback-connector-redis

EXPERIMENTAL: Redis connector for LoopBack.
http://loopback.io/doc/en/lb2/Redis-connector.html
Other
36 stars 46 forks source link

fix destroyAll() with no WHERE filter #7

Closed xrstf closed 8 years ago

xrstf commented 9 years ago

My application is doing

app.models.Something.destroyAll(done);

as the beforeEach hook in my mocha tests. This works perfectly fine for MySQL and MongoDB, but fails with Redis. Apparently, the "do we have a where filter?" check incorrectly sees an empty object as a valid filter.

This PR applies the same logic as is already implemented in count() (see a few lines below in the code) to destroyAll().

slnode commented 9 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

superkhau commented 8 years ago

@slnode test please

superkhau commented 8 years ago

Can you add a test to verify your fix and also prevent regressions in the future?

slnode commented 8 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

langxiong commented 8 years ago

I have the same fix. And this works fine for me. Redis connector is very useful for me. Dose strongloop has any plan to support it offically?

superkhau commented 8 years ago

@langxiong Would you like to submit a PR?

superkhau commented 8 years ago

@xrstf Are you still keen on landing this? Can you add some tests to verify your changes and prevent regressions in the future?

slnode commented 8 years ago

Can one of the admins verify this patch?

superkhau commented 8 years ago

Closing due to inactivity. If you are still running into problems, feel free to leave a comment and I will reopen the issue.