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

Querying associated model exists or not #3408

Closed
fanttm opened this issue May 16, 2017 · 3 comments
Closed

Querying associated model exists or not #3408

fanttm opened this issue May 16, 2017 · 3 comments
Labels

Comments

@fanttm
Copy link

fanttm commented May 16, 2017

I have read #1744, I know that

m1.m2s({
  include: [
    {
      relation: 'm3s',
      scope: {
        where: {
          someCondition: something
        }
      }
    }
  ]
})

This returns all m2s and includes m3s with matching condition which is perfect. And maybe some m2s has no m3s.

Then I want to get m2s that has at least 1 m3s, How can I do about it?

@padelagani
Copy link

@fanttm

It is not currently supported in loopback, you can use native query if you want.

@stale stale bot added the stale label Aug 23, 2017
@stale
Copy link

stale bot commented Aug 23, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Sep 6, 2017
@stale
Copy link

stale bot commented Sep 6, 2017

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

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

No branches or pull requests

2 participants