neonstalwart / mongo-rql

Convert RQL into MongoDB queries
Other
3 stars 2 forks source link

I'm having a lot of problems with dates #1

Open thardy opened 9 years ago

thardy commented 9 years ago

Do you have dates working with this? I can't seem to get simple queries to work with dates. Here are some results...

Query: "created=lt=date:2015-06-10" Error: unsupported operator: undefined

Query: "created=lt=2015-06-10T00:00:00Z" URIError: Unknown converter 2015-06-10T00

Query: "created=lt=date:2015-06-10T00:00:00Z" URIError: Invalid date 2015-06-10T00

After adding the fixes from https://github.com/kriszyp/rql/commit/3e166a2f7c9fb67f03033ce00a05350bcd079948 and retrying "created=lt=date:2015-06-10T00:00:00Z"

I get... Error: unsupported operator: undefined

I saw several issues in both persvr/rql and kriszyp/rql (a fork of the former) related to dates, but the npm package you depend on (kriszyp/rql) does not have any of those fixes published. kriszyp/rql, is behind persvr/rql by several commits, yet I see some fixes in master. Those fixes are not in the package that gets published by npm, however.

Can we get an updated version of the kriszyp/rql package that has some of the fixes from the last quarter of 2014 in it? kriszyp/rql doesn't have an issues page available on his github page to let him know about the issues. I was hoping you either knew the author or simply had your own solution for using dates with this mongo-rql package.

thardy commented 9 years ago

Update - I just pulled master of mongo-rql and master of kriszyp/rql and dumped them into my project and have the same problem. It appears that dates don't work with the latest versions of these projects. I will try to debug, but I could use some help.

thardy commented 9 years ago

I created a pull requests with two failing tests that display the problem - https://github.com/neonstalwart/mongo-rql/pull/2