Example:
Event.belongsTo(compound.models.User,{ as: 'user', foreignKey: 'user_id'})
User.hasMany(compound.models.Event, {as: 'events', foreignKey: 'user_id'})
Event.create({user_id: "518aa9bdfb6a877d24000003"})
Above code write "user_id" field as a string to MongoDB.
It should be ObjectID.
And the following code doesn't work:
user.events(function(err, events){
// events is empty list. I guess it is related with "string" value of event.user_id
})