We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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 })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example:
Above code write "user_id" field as a string to MongoDB.
It should be ObjectID.
And the following code doesn't work:
The text was updated successfully, but these errors were encountered: