js-data-rethinkdb icon indicating copy to clipboard operation
js-data-rethinkdb copied to clipboard

Adds support for like/notLike and contains/notContains operators

Open recipher opened this issue 9 years ago • 14 comments

Hi. After further investigation, I've added support for contains/notContains matching against an array field, and like/notLike matching against a string field. The like/notLike operators bring parity with the js-data-sql adapter.

Unfortunately, I don't believe it's possible to use a single operator to handle both cases - against a string field or an array field. Using two operators is necessary, since there's no way from the adapter to determine which type the field has.

Thanks.

recipher avatar Sep 22 '15 20:09 recipher

That's probably a good approach, one that we should adopt across js-data and all of the adapters.

jmdobry avatar Sep 22 '15 21:09 jmdobry

Any decision on this?

recipher avatar Nov 13 '15 11:11 recipher

I'll take a look tonight, but for starters:

This branch has conflicts that must be resolved

jmdobry avatar Nov 13 '15 17:11 jmdobry

Thanks. findAll specs use yield now. I'll fix them up.

recipher avatar Nov 13 '15 17:11 recipher

I should point out, I didn't commit the distribution (against the contributing rules), it's been updated in this commit after I merged from master. Cheers.

recipher avatar Nov 13 '15 18:11 recipher

ty

jmdobry avatar Nov 13 '15 18:11 jmdobry

If you want to get this up-to-date with master and squash into 1 commit, then I'll merge and rebase v3 so v3 can get support for like/notLike (v3 already has support for contains/notContains).

jmdobry avatar Mar 18 '16 05:03 jmdobry

Also, remove from this PR your changes to the dist/ file, thanks!

jmdobry avatar Mar 18 '16 05:03 jmdobry

Will these operators be made available in a version 2 release? I'm trying them out now. Using the http adapter to interact with a rethinkdb backend that's filtering data sets on the front-end.

calmdev avatar Jul 02 '16 03:07 calmdev

Well, right now they're not available. I can't merge this PR until the conflicts are fixed.

jmdobry avatar Jul 02 '16 04:07 jmdobry

Right, I'd like to help if I can, but it's unclear to me if this will only be merged into version 3, or if this will also land in version 2. I'm hoping version 2 can receive a feature release. Does this require a PR against both v2 and master branch? It's been 9 months since the PR was opened. What exactly is still applicable from this PR? Only the additions made to src/index.js? I'm not seeing how the spec test for the findAll method applies to the branches. Maybe things have just changed since the PR was originally made?

calmdev avatar Jul 02 '16 12:07 calmdev

I am noticing that when where is present it doesn't seem to acknowledge offset or limit.

calmdev avatar Jul 02 '16 14:07 calmdev

Yeah, things have changed quite a bit. Perhaps I should just extract the parts that are still relevant.

jmdobry avatar Jul 02 '16 15:07 jmdobry

If this makes it into version 2 and you need a tester let me know. For now, I'm working around my issue using the underlying rethinkdbdash instance. Looking forward to version 3 of js-data 🚀

calmdev avatar Jul 09 '16 20:07 calmdev