Official query syntax for $gt, $gte does not work
See original GitHub issueSteps to reproduce
I got a feathers-reactive service and i want to query some objects that have dates (named start in the example) that are greater then now:
this.someService.find({ query: { $sort: { start: 1 /* sorting works */ }, start: { $gte: moment().startOf('day').toDate() /* this breaks the updates */ } }, rx: { listStrategy: 'always' /* doesn't help */ } }); });
Expected behavior
I’m expecting updates to my subscription
Actual behavior
Initial query works, no updates (created …). Because of the initial query is working fine and because without the $gt on “start” the updates also work i think the issue is in feathers-reactive
System configuration
“feathers”: “^2.1.3”, “feathers-hooks”: “^2.0.1”, “feathers-reactive”: “github:feathersjs/feathers-reactive”, “feathers-rest”: “^1.7.3”, “feathers-socketio”: “^2.0.0”,
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (6 by maintainers)
Top GitHub Comments
This is a closed issue, but I just wanted to point out I had difficult time filtering Date Range with nedb. The problem was I was storing Date object inside nedb and when filtering date from Feathers Client it was not working. The cause was Feathers converted the Date object to date string before the Find process, when nedb is expecting Date object. So all I have to do was convert the date string to Date object using before hook and filtering worked. Hope my finding helps people who have similar issue.
Great find @jobobo21 !! Thanks Indeed the date had to be in this format: ‘YYYY-MM-DDTHH:mm:ss[Z]’ and not a standard date object. Strange that every other crud method worked… This should really be documented somewhere, I spend so many days debugging 😄