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

filter with related model's properties #730

Closed
FelipeAguayo opened this issue Oct 6, 2015 · 8 comments
Closed

filter with related model's properties #730

FelipeAguayo opened this issue Oct 6, 2015 · 8 comments

Comments

@FelipeAguayo
Copy link

I have the following situation:

Model:

{
  "name":"Model",
  "plural":"Models",
  "idInjection":true,
  "properties":{
     "name":"string"
  },
  "relations":{
    "relOtherModel":{
      "type": "belongsTo",
      "model": "OtherModel",
      "foreignKey": "idOtherModel"
    }
  }
}

values Model:

[ {id:1, idOtherModel:1, name:'one'}
, {id:2, idOtherModel:1, name:'two'}
, {id:3, idOtherModel:2, name:'three'}
, {id:4, idOtherModel:3, name:'four'}]

OtherModel:

{
  "name":"OtherModel",
  "plural":"OtherModels",
  "idInjection":true,
  "properties":{
     "name":"string",
     "state":"string"
  }
}

values OtherModel:

[ {id:1, name:'otherOne', state: 'created'}
, {id:2, name:'otherTwo', state: 'deleted'}
, {id:3, name:'otherThree', state: 'created'}]

I want to get the values of "Model 1" that belong to "OtherModel" with state "created".

Example:

Result values:

[ {id:1, idOtherModel:1, name:'one'}
, {id:2, idOtherModel:1, name:'two'}
, {id:4, idOtherModel:3, name:'four'}]

Any solution? :(

PD: the query must be from Model.

@jlvdh
Copy link

jlvdh commented Oct 8, 2015

Seems related to: strongloop/loopback#517

@superkhau
Copy link
Contributor

@FelipeAguayo Can you verify if your issue is related to strongloop/loopback#517?

@FelipeAguayo
Copy link
Author

yes, but i'm working with the mysql connector.

@superkhau
Copy link
Contributor

Thanks. I will mark this issue as a duplicate.

@bajtos
Copy link
Member

bajtos commented Jun 2, 2016

I think this is not exactly a duplicate of strongloop/loopback#517, let's keep it open.

@bajtos
Copy link
Member

bajtos commented Jun 2, 2016

Actually let's use strongloop/loopback#683 to keep track of this feature request.

@pookdeveloper
Copy link

This is not resolved yet ? Thanks

@bajtos
Copy link
Member

bajtos commented Dec 3, 2018

This is not resolved yet ?

No, see strongloop/loopback#683

@loopbackio loopbackio locked as resolved and limited conversation to collaborators Dec 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants