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

Add the include filter #28

Open
pulkitsinghal opened this issue Aug 23, 2015 · 5 comments
Open

Add the include filter #28

pulkitsinghal opened this issue Aug 23, 2015 · 5 comments

Comments

@pulkitsinghal
Copy link

Notes to learn from mongodb's implementation:

  1. https://github.com/strongloop/loopback-connector-mongodb/blob/367bc033a546130b9f834d17a9d4f769aaefef92/lib/mongodb.js#L730
  2. https://github.com/strongloop/loopback-connector-mongodb/blob/2a90951c482508bdc06d04e5a5b87e8e54f1ae6f/test/imported.test.js#L9
  3. loopback-datasource-juggler/test/include.test.js

In the meantime a workaround is to use the native filter instead of include to write the query using ES's DSL instead of loopback. Ofcourse you need to have already setup parent-child mappings in the datasource correctly no matter what.

@pulkitsinghal
Copy link
Author

cc @anana54, @rabee3 and @zelphir - this issue may be of interest to you when its finished

@RabeaWahab
Copy link

thanks @pulkitsinghal, will be checking it.

@pulkitsinghal
Copy link
Author

I'm thinking that this also ties into the finishing #24 first ... should I make the include filter smart enough to look at the mappings and then form queries differently to support both nested and parent/child approach?

Should I do the work in increments so that until posts for children #24 (in parent/child) aren't done ... only nested mappings are supported for includes.

Honestly I am not a fan of nested and like the parent/child approach more but someone who scales differently in production might disagree. So I would like to write the best generic implementation possible. Will have to give this some more thought.

aquid added a commit that referenced this issue Feb 1, 2017
Include filter was not working. There was a discussion about implementation of include filter in issue #28 which is still pending. I have implemented the minimum workflow to make include filter work until we optimise it for better performance.
aquid added a commit that referenced this issue Feb 23, 2017
- Fixed Issue #79  - Multiple where clause filter support without `and` filter
  - this issue was fixed in PR #78
- Fixed Issue #73  - Nested and, or filter support added
  - this issue was fixed in PR #75
- Fixed Issue #73  - `inq`,`nin`,`between`,`neq` filter support added
  - this issue was fixed in PR #75
- Fixed Issue #28 - Include filter added
  - Minimum workflow to make include filter work until we optimize it for better performance.
    This issue was fixed in PR #71
@aquid
Copy link

aquid commented Feb 24, 2017

@pulkitsinghal Please close this issue if you think the latest release serves our purpose. I know you want a better solution for include rather than using loopback's fallback way. Please refer to the commit above and do the needful.

@pulkitsinghal
Copy link
Author

@aquid - How does the include implementation handle or behave in extremely large datasets? Can you or Bhushan share some numbers? If not that then maybe at least a high level prediction and reasoning if it will do well or poorly when 1k or 10k or 100k or 1m results are processed as part of a matching include query?

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

No branches or pull requests

3 participants