allcount / allcountjs

Rapid application development framework for Node.js
http://allcountjs.com
MIT License
402 stars 83 forks source link

Added code for filtering with $or and $and #118

Closed m-byte closed 8 years ago

m-byte commented 8 years ago

Since I needed to do some slightly more complex filtering, I modified storage-driver.js to support this. It is now recursively scanning through the filtering object.

paveltiunov commented 8 years ago

Incredible work! Thanks for that! This is really complex stuff.

@m-byte do you think you can add some tests for it?

m-byte commented 8 years ago

@paveltiunov sure, shouldn't be a problem.

One question though: Should the user rather enter filters in Mongodb syntax ($or: {}) or Strongloop syntax (or: {})? Right now, it is $or: {}. It would be easy to change, though.

m-byte commented 8 years ago

@paveltiunov which file do the tests belong into? A new storage-driver-test.js or one of the existing ones?

paveltiunov commented 8 years ago

@m-byte I think we can support both 😄 Yep. You can add it to storage-driver-test.js.