Most voted "sequelize-js" questions
Sequelize is a Javascript library for Node.js that allows easy access to Postgresql, Mysql, Sqlite and Mariadb databases and maps database records to objects and vice versa (ORM). Use this tag together from the database tag used when pertinent (e.g., syntax errors).
Learn more…128 questions
Sort by count of
-
-1
votes1
answer29
viewsHow to format the date to the Brazilian standard in an attribute of type "DATEONLY" using sequelize?
I own a model with a date attribute of type DATEONLY, when I step into the body of the request 01/02/1999, and the return is "date": "1999-01-02". How can I format for the Brazilian standard? date:{…
-
-1
votes1
answer57
viewsMysql to Sequelize
I would like to turn this code into Mysql SELECT pets.nome, pets.pulseira AS pets , localizacao.datahora, localizacao.latitude, localizacao.longitude AS localizacao FROM pets JOIN localizacao ON…
-
-1
votes1
answer1002
viewsHow to make a relationship with two items from the same table in Sequelize?
I have a table that holds two user Ids. The UserId and the ResponsibleId, both take from the table User. Model: module.exports = (sequelize, DataTypes) => { const Table = sequelize.define(…
-
-1
votes1
answer960
viewsRun sequelize migrate on a Docker container
Hello! I have my development environment set up in Docker. package json.: { "name": "teste_sequelize", "version": "1.0.0", "description": "teste do sequelize", "main": "app.js", "scripts": {…
-
-1
votes1
answer368
viewsSequelize foreign key error
Well, I was trying to implement the relationships with sequelize, I don’t know if I misunderstood the documentation but from what I understood it should work, below the model I want to make the…
-
-1
votes1
answer645
viewsHow to resolve Error: Cannot find module 'C: wamp64 www sqlnode index.js'
When I try to run my server in Ode, this error message is displayed, I checked the models and paths of the files I am including and apparently everything is right. So is my index.js file: const…
-
-1
votes1
answer35
viewsProblems with Promisse: Promisse[Object]
I’m developing an application and I’m doing database queries with a predefined model, I’m trying to use an asynchronous function to store the value of this query in a variable. Below follows the…
-
-1
votes1
answer475
viewsSequelize Create method does not insert an object field
I am making an application with Sequelize, and when I run the model.create({obj}) function, one of the fields is not inserted in the database. The field in question is a Foreign key from another…
-
-1
votes1
answer233
viewsError using create in sequelize
Good evening. I just started studying Node.js and am having trouble using . create in Sequelize. The error happens when I try to register a user: routes.get('/', async (req, res) => { const user…
-
-1
votes1
answer821
viewsSelect in the Sequelize
I am trying to query the sequelize but I am not succeeding. I need to search for a collaborator in the bank by license plate. However, the employee must be from the same sector as the manager logged…
-
-1
votes1
answer239
viewsSELECT WITH CAST OR CONVERT TO AN ILIKE USING SEQUELIZE
I need to do a full-text search using sequelize, but when I place an iLike to search for an element of an integer or date type column, I can’t send a String, as I would a cast to search for that…
-
-1
votes1
answer124
viewsSequelize GEOMETRY type field
Hello, I wanted to create a table using Migrations with sequelize, and create a position field of type GEOMETRY. The bank I’m using is the postgres. I tried that code: 'use strict'; module.exports =…
-
-1
votes1
answer94
viewsBe displaying the data on the front end with Node.js
I’m having a problem where basically when inserting the data of two mysql tables in front-end I’m not getting, I think I’m reporting in the wrong way. // Exibir post app.get('/cad', function(req,…
-
-1
votes1
answer260
viewsHow to create and modify the same record with Sequelize?
I am developing a scheduling system but came across the following difficulty: In the schedule table (Appointment) has a field quantidade and would like each time a record was created to add +1 in…
-
-1
votes1
answer31
viewsStrategy for big queries
I’m working on an application that features a map and needs to render hundreds of thousands of markers. The data for rendering is in the database and the query is costly. There is also the challenge…
-
-1
votes1
answer58
viewsError: Please install tedious package Manually
I am trying to do a project in Node.js / Electron and need to get information from an SQL Server database. When I run the line below, the error appears: const db = new Sequelize('banco', 'sa',…
-
-1
votes1
answer14
viewsError ondelete Scade sequelize
I am in error when I will do the cascade deletion , using postgres sequelize in version 6. original: error: update or delete on table "Users" violates Foreign key Constraint "Tarefas_userid_fkey" on…
-
-1
votes0
answers18
viewsProblem using environment variables with Sequelize
I’m having a problem when I try to connect my database via Node setting environment variables. The variables I’m trying to set: file . env DIALECT_KEY='postgres' HOST_KEY=127.0.0.1…
-
-2
votes1
answer201
viewsHow do I count records after a specific date in Sequelize?
I am creating an API in Nodejs using Sequelize to facilitate the manipulation of data from a Mysql database. I have a list of appointments and I need to count how many appointments a patient has…
-
-2
votes1
answer44
viewsNodejs Select database when logging in
Hello, good afternoon. I’m dealing with a project that will work as a service, the client has some knowledge in IT and requested that users can select the database when logging in, for example: On…
-
-2
votes2
answers635
viewsUnhandledpromiserejectionwarning: Sequelizeforeignkeyconstrainterror
insert or update on table "appointments" violates foreign key constraint "appointments_user_id_fkey" I have this error in Nodejs when trying to create a new table that has foreign key in Migration,…
-
-2
votes1
answer58
viewshow to pass multiple database queries to a route?
Problem: I am developing an application in Nodejs + Express and I have reached a stage where I need to pass several queries to the database by a single route. NOTE: I use the Sequelize ORM to…
-
-2
votes1
answer102
viewsLIKE for timestampz sequelize
I am trying to filter the activities by date but the field is timestampz. The bank I am using is the postgres { "name": "SequelizeDatabaseError", "parent": { "name": "error", "length": 220,…
javascript node.js query sequelize-js operator-likeasked 4 years, 9 months ago Gabriel Guizardi Cardoso 1 -
-2
votes1
answer360
viewsSequelize error when performing BD registration [Model.hasMany called with Something that’s not a subclass of Sequelize.Model]
I’m doing a Ode project, using sequelize as ORM. I have 4 tables relating [Factor, Subfactor, Obs_factor, Goals], when I will run the create of this error: Error: Factor.hasMany called with…
javascript node.js postgresql relational-model sequelize-jsasked 4 years, 9 months ago Tarcisio pieroni 3 -
-2
votes1
answer136
viewsModel filter tied by Sequelize
I have two models in my application, Delivery and Deliveryproblem. Deliveryproblem has a PK (delivery_id) of Delivery: static associate(models) { this.belongsTo(models.Delivery, { foreignKey:…
-
-2
votes1
answer570
viewsGroup By with Sequelize
I have the following class structure: I’m trying to group and count Sequelize how many titles each selection had from the table Cup_Selections same as the query typed below: My Node consultation…
-
-2
votes2
answers217
viewsNodejs and Mysql: Query 3 columns
I need to make sure that the user will not be able to register the registration: email, cpf or cnpj again. I have a code, which I can restrict email. How to implement the code to check in the table…
-
-2
votes1
answer102
viewsBelongstomany Relationship - Sequelize
Hello, I have a problem in listing records with belongsToMany association using sequelize + nodejs. I have the tables Developers and Technologies. The relationship between them is Many to Many. To…