Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#15226·sequelize

Missing `upsertKeys` property from `bulkCreate` query interface documentation

Author: joshtyfCreated Nov 3, 2022Updated Sep 2, 2026
Labelsdocstypescript

Issue Creation Checklist

  • I have read the contribution guidelines

Issue Description

When using the updateOnDuplicate option for bulkCreate, this error is raised: TypeError: Cannot read properties of undefined (reading 'map').

The error is not helpful as it doesn't mention what is undefined.

However, it does provide a trace to the line const conflictKeys = options.upsertKeys.map((attr) => this.quoteIdentifier(attr)); in the bulkInsertQuery method.

This trace highlights that upsertKeys is missing from my options. Including it solves the problem.

What was unclear/insufficient/not covered in the documentation

The bulkCreate query interface options documentation points the reader to the documentation for Model.bulkCreate. However, the upsertKeys property is missing from the documentation.

If possible: Provide some suggestion on how we can enhance the docs

Provide documentation foroptions.upsertKeys in Model.bulkCreate.

Additional context

This is for v6 of Sequelize.

Screenshot of missing documentation in Model.bulkCreate as of issue creation time. Screenshot 2022-11-03 at 6 34 59 PM

Source: sequelize/sequelize

View original on GitHubView discussion on GitHub