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

ReferencesMany relation type #2488

Closed
bajtos opened this issue Feb 26, 2019 · 7 comments
Closed

ReferencesMany relation type #2488

bajtos opened this issue Feb 26, 2019 · 7 comments
Assignees
Labels
feature parity feature Relations Model relations (has many, etc.)

Comments

@bajtos
Copy link
Member

bajtos commented Feb 26, 2019

A ReferencesMany relation embeds an array of foreign keys to reference other objects.

An example model instance:

{
  id: 1,
  name: 'John Smith',
  accounts: [
    "saving-01", "checking-01",
  ]
}

See also LB 3.x docs: https://loopback.io/doc/en/lb3/Embedded-models-and-relations.html

@bajtos bajtos added feature Relations Model relations (has many, etc.) feature parity 2019Q2 labels Feb 26, 2019
@bajtos bajtos added 2019Q3 and removed 2019Q2 labels Apr 9, 2019
@dhmlau dhmlau added 2019Q4 and removed 2019Q3 labels Jun 25, 2019
@dhmlau dhmlau added p3 and removed p3 labels Sep 24, 2019
@dhmlau dhmlau removed 2019Q4 labels Oct 3, 2019
@alparslanyilmaaz

This comment has been minimized.

@achrinza

This comment has been minimized.

@mrbatista
Copy link
Contributor

@bajtos Please assign the task to me.

@spr1ne
Copy link

spr1ne commented Dec 15, 2020

In most frameworks, hasMany do this behaviour by default (return only ids), but when you pass { include: 'entity' }, it behave like embedded. What you think about it?

@hadnet
Copy link

hadnet commented Dec 16, 2020

Is this relation not implemented in LB 4 yet?

@njtnestor
Copy link

njtnestor commented Feb 21, 2021

I need this relation, when will be implemented? It is highly necessary to work with mongo

@DavidKrpt
Copy link

We are also using mongodb, and we have to either use hasManyThrough in those cases where referencesMany would be the obvious best choice according to mongodb data modelling best practices, or imitate referencesMany with custom repository methods. Either way it is inconvenient and has overhead costs.

If there are any details about the implementation of this feature, can you please share them ?

Also, can you recommend other workarounds besides the two I mentioned above?

mikeevstropov added a commit to mikeevstropov/loopback-next that referenced this issue Mar 30, 2022
closes: loopbackio#2488

Signed-off-by: Mike Evstropov <mike.evstropov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature parity feature Relations Model relations (has many, etc.)
Projects
None yet
Development

No branches or pull requests

9 participants