Skip to content

ReferencesMany relation type #2488

Closed
Closed

Description

@bajtos

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

Activity

  1. alparslanyilmaaz commented on May 8, 2020

    @alparslanyilmaaz
  2. achrinza commented on May 8, 2020

    @achrinza
  3. mrbatista commented on Nov 17, 2020

    @mrbatista
    Contributor

    @bajtos Please assign the task to me.

  4. spr1ne commented on Dec 15, 2020

    @spr1ne

    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?

  5. hadnet commented on Dec 16, 2020

    @hadnet

    Is this relation not implemented in LB 4 yet?

  6. njtnestor commented on Feb 21, 2021

    @njtnestor

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

  7. DavidKrpt commented on Aug 10, 2021

    @DavidKrpt

    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?

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions