Skip to content

How to filter an Association? #267

@peruzzo

Description

@peruzzo

I want to be able to filter a association, as in the example below only bring the emails assets of a particular user.

var User =  db.define('user', ...);
var Email = db.define('email', ...);
Email.hasOne('user', User, {required: true, reverse: 'emails'});


user.getEmails().find({active: true}).run(...);
user.getEmails().where("active = ?", [true]).all(...);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions