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
-
0
votes0
answers190
viewsECONNRESET with postgres and sequelize in nodejs
Good we are using nodejs v10.13.0 together with him the sequelize 4.42.0 to communicate with our bank postgres 9.2, our server is in AZURE it has 8GB of HAM, 2 CPU and is Centos 7. In the bank we…
-
0
votes1
answer178
viewsError listing posts with Node.js and sequelize
Every time I open the route "/" says finAll is not a function, what is wrong? const express = require('express') const app = express() const handlebars = require('express-handlebars') const…
-
0
votes1
answer113
viewssequelize problem with relays
Hello, I have some tables in mysql, I created the models using sequelize-auto and associations manually. The problem is that when I try to include these relationships I come across the error…
-
0
votes1
answer390
viewsSequelize-auto to the SQL Server database on Node JS
I’m looking to migrate the tables from an existing SQL Server database on Node JS. I made the connection to the bank and it returns me connected. I then run the following command to migrate the…
-
0
votes0
answers168
viewsProblem to run select with sequelize
I’m having trouble executing a select in Nodejs where it takes quite long looking that the same stays in infinite loop. module - sequelizejs bd - SQL server dbConnection const Sequelize =…
-
0
votes1
answer235
viewsError using Mysql Sequelize
Code to establish connection to the database: const Sequelize = require('sequelize') // Conexão com o banco de dados MySQL const sequelize = new Sequelize('postagens', 'root', 'mafikgod123@', {…
-
0
votes1
answer394
viewsExpressjs - Sequelize - Data type not recognized
I manually created an sql database and now I’m trying to configure my sequencing templates to match the columns in my sql tables, but I found a problem with my model related to an unrecognized field…
-
0
votes1
answer503
viewsHow to delete a record with a foreign key using sequelize
I created a web application using sequelize, my model looked like this: const Product = db.sequelize.define('product', { idProduct: { type: db.Sequelize.STRING, primaryKey: true, autoIncrement:…
-
0
votes0
answers754
viewsSequelize Timezone postgresql
I’m performing a sequel, but when I return the information that was recorded, returns with 3 hours above the postgres. json Insomnia: Given in postgres: I tried to change Timezone in sequelize, but…
-
0
votes1
answer43
viewsRelationship belongsToMany does not return duplicates
I have the following models: module.exports = (sequelize, DataTypes) => { const TestPlans = sequelize.define('TestPlans', { name: { type: DataTypes.STRING, allowNull: false, } })…
sequelize-jsasked 5 years, 4 months ago Diego Moura 118 -
0
votes1
answer94
viewsAbout Hooks Classmethods Sequelize
I have a question in the operation of classmethod Hooks etc I have a model: const bcrypt = require('bcrypt'); module.exports = (sequelize, DataType) => { const User = sequelize.define('tb_users',…
-
0
votes1
answer623
viewsselect sequelize performs different query of parameters passed with datetime
This is the function that performs the query: router.get('/out_filtered', async (req, res, next) => { try { const dateStart = req.body.date_start; const dateEnd = req.body.date_end;…
-
0
votes1
answer689
viewsInsert values from a variable into the database with nodejs, mysql and sequelize
I’m trying to input into the database the contents of the variables: token and now. The respective fields in the table users of the bank are: passwordResetToken and passwordResetExpires. I can…
-
0
votes1
answer352
viewsError When Creating Table in Comics with Sequelize | postegres
In terminal when executing command yarn sequelize db:migrate to create the table users of Gobarber in the database, returns the following error: yarn run v1.21.1 $…
sequelize-jsasked 4 years, 11 months ago Felipe Oliveira Saraiva 1 -
0
votes1
answer63
viewsQUERY ERROR sequelize Association LEFT OUTER JOIN API NODEJS
I have the following SQL command: select u.name_user, a.type_administrator from users u inner join administrators a on u.id_user = a.id_administrator; and I need to turn this into my API into Nodejs…
-
0
votes1
answer226
viewsProblem when creating Many to Many association using Sequelize (belongsToMany)
I am getting the following error when defining a Many to Many association between two tables: C:\eadfabet\node_modules\sequelize\lib\associations\mixin.js:49 throw new…
-
0
votes1
answer228
viewsSequelize db:migrate error
Hello! I have a DB Postgres running perfectly on my machine. I can create my Migrations, for example in the following command: npx sequelize migration:create --name=create-users I am trying to run a…
-
0
votes1
answer204
viewsSequelize error: [...]. belongsToMany([...]) requires through option, pass either a string or a model
I’m importing models using the autoloader (index.js) of the sequelize. An Accesslevel model has a relationship with the Menu model (N: N), through the Accesslevelhasmenu model. What should happen?…
-
0
votes1
answer114
viewsProblem with Relationship Sequelize
I have two tables called type_agricultural_implement and agricultural_implement, in which the id of type_agricultural_implement is inside the table agricultural_implement as…
-
0
votes1
answer63
viewsPerform OR operation between two models in Sequelize
In my Proposal table I have two Foreign Keys that reference the same table(Producer), I need to make a Where to check if there is a producer with a document equal to the searched in one of these…
-
0
votes1
answer348
viewsSELECT sequelize
I’m getting the error: (Node:20796) Unhandledpromiserejectionwarning: Typeerror: _Accessojs2.default.query is not a Function, I have the database configuration file: import Sequelize from…
-
0
votes1
answer568
viewsError: Nodejs, javascript "belongsTo called with Something that’s not a subclass of Sequelize.Model"
I am trying to use belongsTo function and get this error. Connection DATABASE has been established successfully. (node:14119) UnhandledPromiseRejectionWarning: Error: User.belongsTo called with…
-
0
votes0
answers56
viewsDoubt/problem redirecting after form submission with Node.js
Well, I’m new to programming and I’m trying to make a prototype of frequency recording to learn a little bit more about how to handle the database. My application has an area that I can be…
-
0
votes2
answers747
viewsHandlebars: Access has been denied to resolve the Property "title" because it is not an "Own Property" of its Parent
I’m having a problem with displaying mysql data by handlebars: Executing (default): SELECT `id`, `titulo`, `conteudo`, `createdAt`, `updatedAt` FROM `postagens` AS `postagens`; Handlebars: Access…
-
0
votes1
answer211
viewsQuery in Sequelize separating Month and Year
Hi, guys. Sorry if my question seems a bit silly, but I’m starting now and doing this query is tying my head in a knot kkk Next, I’m building a system to manage the company’s vouchers (advances). I…
-
0
votes1
answer383
viewsData formatting in Node.JS, with Sequelize and Moment.JS
I would like to format a date that is being loaded from the database with Sequelize. I’m blogging and I need to get the article creation date My route: app.get("/", (req,res) =>{…
-
0
votes1
answer14
viewsError while capturing Tinyurl shorten method
I need to capture the return of the method shorten library TinyUrl. I’m trying to store this return in the variable shortUrl and then save to the bank as follows: import TinyUrl from 'tinyurl'; let…
-
0
votes1
answer493
viewsQuery using Sequelize resulting in "column "id" does not exist" error
I am testing the REST API I am developing. I am using Sequelize and Postgresql. In the API there is the table users with the following fields: user_id user_nickname user_fullname user_password…
-
0
votes1
answer419
viewsBad Request 400 - Using Fetch API
I’m having trouble accessing my api using POST method. This is my requisition: function createTool(token, obj) { return fetch(`${url}/tools`, { method: 'POST', headers: { Authorization: token, },…
-
0
votes0
answers43
viewsI can’t return any information or send it to the database (javascript, Node, sequelize, postgres)
Good afternoon, you guys! I am doing this project of registering classes with login screen, admin user etc. and I am currently assembling the back end of the project. The goal is to create a day and…
-
0
votes0
answers32
viewsHow to count items within a Sequelize association
I have in my database a table called Chefs, and another table Recipes receiving a foreign key called chef_id. Using Sequelize I built in my Controller a code that returns the data of chefs together…
-
0
votes0
answers57
viewsHow to undo a Migration that has reference (References)?
I have a Migration that adds a reference to a column (foreign key), but at the time I run db:migrate:undo He doesn’t break up the relationship at the bank. After some tests the migrations continue…
-
0
votes0
answers142
viewsRelationship error between tables with Sequelize: Unknown column
I am creating a stock management system where a model has category one for many, doing the insertion correctly, but at the time of listing it returns me the error: SELECT `luminarias`.`id`,…
-
0
votes0
answers28
viewsHow to change the Sequelize response object?
I would like to know how to change the answer object in sequelize findAll. I used the code below to make the change but I do not know if in Sequelize itself can do. then(chars => {…
-
0
votes0
answers269
viewsHow to resolve Typeerror: Cannot read Property 'Create' of Undefined?
const express = require ("express"); const app = express(); const handlebars = require ('express-handlebars'); const bodyParser= require ('body-parser'); const Post = require ('./models/Post').…
-
0
votes1
answer35
viewsCreate a table separating dates by quarter with React and Node
The table needs to look like this: She’s like this: I was able to create a table using Sequelize with the data of each unit, with cnpj and everything, and I made a table of dates related to this…
-
0
votes1
answer129
views(Sequelize) Cannot read Property 'title' of Undefined
Hello, I am developing a cart system for Ecommerce, and within the Model Cart, I have made a relationship with User Model and Product Model, so I can access the two items through the Cart. However,…
-
0
votes1
answer45
viewsIs the use of the operator "and" in this code correct? Because it is not working
The function of this code is to receive the login data through the req and do with query to see if the records exist and the user can access certain area, but the code below not be indifferent as…
-
0
votes1
answer33
viewsSend the result of two Mysql tables to a view (ejs)
I am working with Ejs and Node.JS with Mysql. I need to move to a two table info calculation view, but I am facing this error: app.get("/calc", (req, res)=>{ Palpite.findAll().then(calc =>{…
-
0
votes0
answers19
viewsHow to create a record in nested tables in sequelize?
I have a users table and a posts table: const users = sequelize.define(users, { nomeuser : { sequelize.STRING }) users.sync() const post = sequelize.define(postagens,{ potagens:{ type:…
sequelize-jsasked 3 years, 10 months ago user133519 3 -
0
votes0
answers45
viewsHow to Calculate Nodejs Points with mysql and sequelize of several Users
Calculo Onde puxo informções do banco || calculo acontece de forma correta pore o envio para o banco atravez do update funciona não corretamente. Basically it would pull through a loop pass through…
-
0
votes0
answers24
viewsHow to perform Join with another bank table, with different Rvers, using Sequelize?
I have a connection with two databases, with different servers, and would like to perform the Join between the tables of the two banks, using querybuilder. Would someone please help me? import…
-
0
votes0
answers33
viewsSequelize error while trying to connect to database "Dialect needs to be explicitly supplied as of v4.0.0"
I am trying to establish a connection to my postgres database using the sequelize, when I try to connect it accuses the following error, even with the dialect parameter being defined, yet it says it…
javascript database postgresql sequelize-jsasked 3 years, 9 months ago Marco Aurélio Lopes Júnior 145 -
0
votes1
answer23
viewsProblem accessing an attribute dynamically inserted into a Sequelize "ready" object
In a certain part of my code I have to set this field/attribute (actualValue) on an object coming from Sequelize (I can’t store the field in the database), but when doing mine if I cannot directly…
-
0
votes1
answer37
viewsAuto increment in postgres/sequelize
I have a Postgres database using Sequelize (Node/express) as ORM. I have a table called Students, there are columns: id and name. In this table Students, I have several registered students, however,…
-
0
votes0
answers33
viewsProblems in ordering a sub-sub-association - Sequelize
I wanted to order a sub-sub-association by ASC "orderMeta", but for some reason I tried to take a look at the documentation and I can’t, I put part of my code. orderMeta is found in the association…
-
0
votes0
answers14
viewsTDD with Jest and sequelize - POSTGRES Migration error for SQLITE
I am implementing TDD with Jest in a Node with express application, my database is POSTGRES and I have several sequelize Migrations already configured, and for my test scenarios I am running these…
-
0
votes0
answers13
viewsWhy does the sequelize id auto-increment even without adding the data?
Hello, I have a table that has[id, user, password, level] following these settings: id: { type:sequelize.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false }, user: { type:…
-
0
votes0
answers14
viewsSequelize Error: Sequelizedatabaseerror
Hello, I am building my application on Node and using postgres database. I come across the following error: SequelizeDatabaseError: column \"zipcode\" of relation \"users\" does not exist" My model…
-
-1
votes1
answer99
viewsRecover DB data from a certain date
I am creating an api in Node.js, using express and Sequelize as ORM. I would like to know, which expression should I use to recover DB data from a certain date. I’m using the date-fns to determine…