Skip to content
Advertisement

Tag: node.js

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

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 http://d205bpvrqc9yn1.cloudfront.net/0007.gif alternate lateral pulldown lats back 2 chest http://d205bpvrqc9yn1.cloudfront.net/0009.gif assisted chest dip (kneeling)

Relational database created/stored on client [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 5 months ago. Improve this question I’m in the early stages of designing an Electron application that

UNION ALL Slower than N queries

This question is following this question where I wanted to select the MAX value of multiples fields while retrieving each row. The accepted answer with UNION ALL worked like a charm but I now have some scaling issues. To give some context, I have more than 3 million rows in my matches table and the filters used in the WHERE

How to convert Buffer to base64 image in Node js

I am getting data from my SQL database like this: How can I convert result to a base64 image in Node.js? For Example: ‘data:image/png;base64,iVBORw0KGgoAAAANS’ Answer Since you’re receiving a Buffer back as output, Buffer.toString(‘base64’) will convert the raw binary data in the buffer to a base64 representation of the data. Buffer.toString() can also take other encodings, you can read more

Advertisement