U
U
ura2rist2019-11-18 19:34:32
Node.js
ura2rist, 2019-11-18 19:34:32

How to make a query to the database and display certain columns?

The situation is this. The database has a column with IDs. That is, there may be one number, for example 5, or there may be two, for example 4.5
How to make it so that when querying the database and searching for the value 5, it also catches the column in which there are several numbers.

otd.findAll({where:{
    Id:request.body.data},
    raw: true
  }).then(otd=>{
    if(!otd.length){
      response.json(nonOtd);
      return console.log(nonOtd);
    }

Right now it only looks for requests with 1 number exclusively.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question