Skip to content
Advertisement

Tag: sequelize.js

sequelize compare date with date-timestamp

my simple use case is I pass a date and try to compare that with the default createdAt column. and my date is a string like this date = ‘2018-12-12’ The problem here is sequlize not compare only the date. But it does add time 00:00:00 to my date and then compare. So the query sequlize generate is like this.

Sequelize relationship query returns duplicate data

I’m querying customer orders for a specified customer using Sequelize relationships. index.js service.js results expected Answer All you need is to remove raw: true, from query , as it will return plain/flat object , and that will convert your object as it looks now. Note : You should put the where condition in upper level as per your logic

Sequelize.js – “is not associated to”

I have some issue with getting full data from db. That are my models: User Role I want to get object of one specific user including all role content. Somethink like So I’m using: but I get in the result err.message: “role is not associated to user” And the simple question – what’s wrong ? 🙂 *to handle models I’m

Advertisement