HI.I have some difficulty with usage
sequelize.js. There are the following data model (simplified):
var Organization = sequelize.define('organization', {
organizationRegId: {
type: Sequelize.STRING(250),
field: "organizationregid",
}
});
var Person = sequelize.define('person', {
organization: {
type: Sequelize.STRING(250),
field: "organizationid",
}
});
Need to get all users whose identifier (
organizationregid) intersects with the organization identifier in the organization (
organizationid).
In sql query looks like this:
SELECT * FROM persons AS p LEFT JOIN organizations AS o ON p.organizationid = o.organizationregid;
I can't change data schema.
I'm experimented with
hasMany, but failed.