Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparing between field names #48

Open
xescuder opened this issue Sep 24, 2018 · 3 comments
Open

Comparing between field names #48

xescuder opened this issue Sep 24, 2018 · 3 comments

Comments

@xescuder
Copy link

I have an array with elements like:

{
start:5
end: 6
}

There's any way to do a search in array (matchArray) to find all objects where {start:{gte:end}} or {start:{gte:end-1}} ?

I'm interested in doing that sort of things, and I think your library is great, but I need something like this.
Thanks!

@deitch
Copy link
Owner

deitch commented Sep 24, 2018

So you want the search field to be relative to another field? Rather than {start: {gte: 5}} you want to check where the value of one field (start) is gte (or some other comparator) to another field?

@xescuder
Copy link
Author

Yes, exactly. That's what I need. I need also to check for example if (start gte end*0.75).

@deitch
Copy link
Owner

deitch commented Sep 24, 2018

No support for it now, but no reason it couldn't be extended to do so. The comparisons take place entirely in this function. It would need to be extended to be able to handle field being not just an absolute value, but perhaps an object that could contain relative fields.

Would also need a way to change the syntax in the query.

Go for a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants