• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

206
Views
Sequelize returning null values from database (API problem)

I seem to have a problem with Sequelize . The thing is i have set an SQL database , when i try to reach it via sequelize (node) it just returns nulled values


[
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    },
    {
        "id": null
    }
]

This is my service, When i create an object inside the findUsers function and return as if it is real data , it just works


const User = require('../models/User');


const addUser = async (user) => {
  try {

    await User.create(user)
  } catch (e) {
    console.log(e);
  }
}

const findUsers = async () => {
  try {
    //return await User.findAll({});
    const u =   User.findAll();
    /*u = {
      nom : "lozo",
    }*/
    return u;
  } catch (e) {
        console.log(e)
  }
}
module.exports = {addUser,findUsers}
about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error