neonstalwart / mongo-rql

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

Added two failing date query tests #2

Open thardy opened 9 years ago

thardy commented 9 years ago

Date queries are not working in mongo-rql.

I can get the tests "closer" to passing by implementing the following two changes, but then I quickly get into code I'm not currently understanding...

  1. Implement the fixes from https://github.com/kriszyp/rql/commit/3e166a2f7c9fb67f03033ce00a05350bcd079948. It's simply two line changes in a single file that enable correct parsing of date strings
  2. Substitute line 25 of index.js with if (value && typeof value === 'object' && !(value instanceof RegExp) && !(value instanceof Date)) {. This appears to fix the Error: unsupported operator: undefined error.

After this, I hit a dead end. A map reduce takes what appears to be a valid criteria and completely strips it out, and I can't figure out what the reduce is supposed to be doing.