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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions