Skip to content

User DataQueryable.contains() for getting many-to-many associations #160

Description

@kbarbounakis

Description
DataQueryable.contains() may be used for filtering items based on a many-to-many association e.g. get users that belong to Administrators group.

const group = await context.model('Group').where('name').equal('Administrators').getItem();
const users = await context.model('User').where('groups').contains(group).getItems();

Activity

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

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