0

I'm using Sails.js in a production environment. My site queries a MongoDB database to return an array of objects. Each object fills a news section on my site. I have success with the development environment, however, when I try in production the return is an empty array.

let newsQuery = await News.find({
        skip: newsIndex,
        limit: total,
        sort: 'id DESC'
});

I try using just News.find() and the result is the same.

Sam Axe
  • 437
  • 1
  • 8
  • 25
  • Hi, welcome to StackOverflow. You need to provide more information if the community is to help you. Please edit your question to include the exact query you are using. This sort of problem usually results from a lookup in the query - have you got all the reference data present on live that exists in dev? – MandyShaw Jan 17 '19 at 17:29
  • Hi Rafael! Welcome to SO! I know you have most likely checked this, but I have to ask. Are you sure the database you connect to in production is the correct one, and that it contains the data? Sails differentiates between development setting and production settings, so you might have a typo or something in your production setup? – Canis Jan 22 '19 at 16:21

0 Answers0