12,497
questions
0
votes
0
answers
10
views
Sequalize Update a column on soft delete
in paranoid table,
Can I merge these two queries into one
await activeSubscription.update({
subscriptionStatus: constants.SUBSCRIPTION_STATUS.CANCELLED
});
await activeSubscription.destroy()...
0
votes
1
answer
25
views
Getting ERR_MODULE_NOT_FOUND in my Heroku App but working fine in localhost
Thanks for being here.
My stack
Postgres
Node 20.17.0
Express
Sequelize ORM
Javascript
When started happening?
This started happening after migrating my app from the 'require' to 'import' syntax. I ...
0
votes
0
answers
10
views
Documentation about Sequelize ignoring unknown attributes
I asked ChatGPT whether Sequelize update or create will ignore extra attributes passed to it.
I have this code and unknownField is indeed ignored. The data does not cause a db error.
const data = {
...
0
votes
1
answer
18
views
Sequelize Grouping by Associations with aliases (model->model2 AS 'alias')
I am having a problem with grouping by associated models that are using aliases.
The table on the client side has grouping, ordering, pivoting etc.
Most of it I have down, but the grouping is causing ...
0
votes
0
answers
15
views
Sequlize - Combine array contains operator with iLike
Following the example from here - https://sequelize.org/docs/v7/querying/operators/#array-contains-operator
Post.findAll({
where: {
tags: { [Op.contains]: ['popular', 'trending'] },
},
});
...
0
votes
1
answer
41
views
How to Query Bookmarked Posts Instead of Authored Posts in Sequelize
I’m new to Sequelize, so I apologize if my question seems basic. I have defined two models in my Sequelize setup: Post and User. I’m trying to query both the posts a user has authored and the posts ...
0
votes
0
answers
25
views
Problem building query sequelize-typescript
I am currently facing an issue when creating a query with sequelize-typescript. The problem arises when trying to fetch records from a many-to-many relationship. Here is the SQL query I am trying to ...
0
votes
0
answers
22
views
How to avoid the "Unknown column" error in Sequelize (MySQL)
How to avoid the "Unknown column" error in Sequelize (MySQL) when a field is missing in the database and return NULL instead of an error in production?
I am working with Sequelize and MySQL, ...
0
votes
0
answers
27
views
In nodejs (sequelize), Add new key or column in MySql via migration
In nodejs (sequelize) ,Add new key or column in MySql via migration but it is not defined in the model so how it update automatically in the model
I have make new migration on adding new column and ...
0
votes
0
answers
23
views
node js Sequelize one to many single create[Solved]
Is there anything wrong with the way the code is wrote? Because using one-tone I can insert the data normally, but when use one to many, the data is just ignored.
The idea is:
Contact Model can have ...
2
votes
1
answer
23
views
Sequelize TypeScript Error: "Property '[OpTypes.and]' does not exist on type 'WhereAttributeHash<any>'"
I'm trying to dynamically build a WHERE clause using Sequelize in a TypeScript application, but I am encountering a typing error when attempting to use [Op.and] within WhereOptions. Specifically, ...
0
votes
0
answers
20
views
Sequellize app.post show Error saving QR history: TypeError: Cannot read properties of undefined (reading 'apply')
I would like to make a post request, to save my built QR Code that I test my route to Postman. Ok,it works my QR code is saved into my database but it show this error message
Error creating QR history:...
0
votes
0
answers
32
views
Generating parameterized SQL statements with Sequelize for SQL Server
I am working with Sequelize on a SQL Server database, and I'm encountering some challenges with how Sequelize generates SQL statements for querying.
Question: is there any way to configure Sequelize ...
0
votes
0
answers
24
views
Squelize Sort By Included Model
I'm struggling to sort cases by the patients first name. I've tried nearly every possibility I feel like I could and still nothing. For some reason, it's changing the column name and then it can't ...
0
votes
1
answer
22
views
Sequelize Alias mismatch
## Product Model ##
module.exports = (sequelize, DataTypes) => {
const Product = sequelize.define('Product', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement:...