Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query 'in' with array of IDs #233

Open
lesterzone opened this issue Oct 27, 2014 · 0 comments
Open

Query 'in' with array of IDs #233

lesterzone opened this issue Oct 27, 2014 · 0 comments

Comments

@lesterzone
Copy link

With latest versiion 13.0.7,

A has many B,
B belongs to A.

/**
 * All I need is get all A related to array of B ids
 */
var ids = ['id1', 'id2'];

A.all({
    id: {
        'in': ids
    }
}, function(err, data) {
    console.log(err, data); // null, []
});

var usernames = ['a', 'b'];
A.all({
    username: {
        'in': usernames
    }
}, function(err, data) {
    /**
     * It works!
     */
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant