Why I cant see the same data on different PCs?

System Information
  • Strapi Version:
  • Operating System:
  • Database: MongoDB
  • Node Version:
  • NPM Version:
  • Yarn Version:

Hi! I’m having a little problem…
I have an endpoint (/favorite-posts) that returns a list of posts
(like)
[
{
title:‘example’,
description:‘example’,
likes:[],
}
]

where ‘likes’ is a ‘hasMany’ relationship.

Now, if a make a request to /favorite-posts on my laptop(localhost), it works. BUT on my PC (localhost) and server(internet), the field likes do not show up.

What can I do?

Which Strapi version are you using?

3.4.1 on my laptop and PC

Most likely the issue is you have different databases on each system, data is stored in the DB and the DB isn’t under source control.

But when I do /posts, I get the field ‘likes’, on my PC, laptop, and server.
Another “issue” that I have is when I call, for example,/user, I get all the data that I want, but I get old fields too (but I guess it is something with the DB).
What do you do suggest to do?

  1. Maybe the code on your server is not updated. Or, if it updated then your strapi was not restarted.
  2. Maybe you use two different databases, one on localhost and another for the server.

You should delete the fields from the DB columns directly.