User.findById(token.id, function( error, user ) {
var message = new Message({content: 'demo'});
message.author(user);
message.save();
});
As a result the message.author_id should be equal to user.id, but in my case it results in that message.author_id contains an [Obejct].
AFAIK from debug information:
This condition always false because user model (and a message model btw) is not an instance of AbstratClass.
Is this normal behavior or maybe I'm missing something here?
Thanx in advance!
I have two models defined with repationships:
Assign author model to the message model:
As a result the message.author_id should be equal to user.id, but in my case it results in that message.author_id contains an [Obejct]. AFAIK from debug information:
This condition always false because user model (and a message model btw) is not an instance of AbstratClass. Is this normal behavior or maybe I'm missing something here? Thanx in advance!