Skip to content

Querying model: filter by related model properties #1754

@ddddm

Description

@ddddm

Hello. Please help me to understand loopback principles.

For example, i have a "User" model with oneToMany relation to "Photo" model with "status" property (string). My goal is to query only "User" which have "Photo"s with status == "active". As i understand from docs i can query "User" model and include "Photo"s there, specifiying "where" field for "Photo" model, but that's not my goal. Instead i want filter "User" based on their "Photo"s statuses. Is it possible with loopback?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions