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
Minor error on docs/v6/advanced-assoc/advanced-many-many
website/versioned_docs/version-6.x.x/advanced-association-concepts/advanced-many-to-many.md
Line 243 in 0ebeecc
is not truthful.
user.grants[].profiles[] should be user.grants[].profile
user.grants[].profiles[]
user.grants[].profile
Super simple repro:
async function main() { let sequelize = require("sequelize"); const { DataTypes } = sequelize; sequelize = new sequelize({ dialect: "sqlite", logging: false }); const User = sequelize.define( "user", { username: DataTypes.STRING, points: DataTypes.INTEGER, }, { timestamps: false } ); const Profile = sequelize.define( "profile", { name: DataTypes.STRING, }, { timestamps: false } ); const Grant = sequelize.define( "grant", { id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false, }, selfGranted: DataTypes.BOOLEAN, }, { timestamps: false } ); User.hasMany(Grant); Grant.belongsTo(User); Profile.hasMany(Grant); Grant.belongsTo(Profile); await sequelize.sync(); // --- const amidala = await User.create( { username: "p4dm3", points: 1000, grants: [ { selfGranted: true, profile: { name: "Queen", }, }, ], }, { include: { model: Grant, include: Profile, }, } ); const result = await User.findOne({ where: { username: "p4dm3" }, include: { model: Grant, include: Profile, }, }); console.dir(result.grants, { depth: 1 }); } main();
The text was updated successfully, but these errors were encountered:
See #568
Sorry, something went wrong.
No branches or pull requests
Issue Description
Minor error on docs/v6/advanced-assoc/advanced-many-many
What was unclear/insufficient/not covered in the documentation
website/versioned_docs/version-6.x.x/advanced-association-concepts/advanced-many-to-many.md
Line 243 in 0ebeecc
is not truthful.
If possible: Provide some suggestion on how we can enhance the docs
user.grants[].profiles[]
should beuser.grants[].profile
Additional context
Super simple repro:
The text was updated successfully, but these errors were encountered: