Skip to content

Tag: node.js

How to pass an SQL function on bulk insert query in node

I have to execute an INSERT INTO query using mysql or mysql2 in node.js The values passed into the query utilizes a spatial geometry function ST_GeomFromGeoJSON() on geoMap column which is of type GEOMETRY. Here is the simplified code: The above code does not work and throws the error Cannot get geometry object from data you send to the GEOMETRY

Sequelize : How to query posts list from user id list?

To learn a little bit how a back end application works i’m currently creating a small instagram-like app using nodejs and sequelize (reactjs for the front). I have 3 SQL tables : Users id (pk) username email password Posts id (pk) userId (fk) message mediaUrl Following id (pk) userId (fk) followingId (fk) I would like to know what is the

req.query returns nothing

Trying to get variable from http://localhost:3000/categories/subcategories?category_id=13 but req.query returns empty result. Is this possibly a problem with the way I’ve set up my server? Answer See how you are passing the data , directly entering the data or from another URL you are passing the data. Ensuring you are not sending data via req.body. Ref : Empty req.query on ExpressJS

Nest Postgresql Sequelize one-to-one Error with ForeignKey

My Table Has one-to-one connection with table But when i try add some data in second table< i got an Error – Nest error insert or update on table “checkingResults” violates foreign key constraint “checkingResults_resultId_fkey” What happened? I try any thing… And how i remember – a don’t get this error before in this place, i don’t touch something in

MySQL Combine Group by Column

I am new to SQL statements so my wording per my request may be incorrect, so I will provide a lot of detail to better understand my issue. I have a database table called workouts that looks like this: id bodyPart gifUrl name target broad_target 1 back alternate lateral pulldown lats back 2 chest assisted chest dip (kneeling)