Strapi doesn't delete content-type field

When making api requests, for example a POST Request to an endpoint named “new-restaurant” , the old fields (that was already removed) still show up in these new entries.

Example: POST request to myrestaurants/new-restaurant

{
id: "restaurant id",
name: "new restaurant name",
zip code: "restaurant zip code",
}

API response:

{
id: "restaurant id",
name: "new restaurant name",
zip code: "restaurant zip code",
}

and when I delete, from the admin pannel, the entry “zip code” from this content-type, and make another request to the same endpoint but without the field that was deleted from this content-type, for example:

POST request to myrestaurants/new-restaurant

{
id: "restaurant id",
name: "new restaurant name",
}

API response is:

{
id: "restaurant id",
name: "new restaurant name",
zip code: null,
}

I tried looking after all the files in my strapi projects, the models, schemas and all of it, and didn’t find this deleted field mentioned anywhere, but it still comes out with my new POST requests, and I don’t know why?!

It happened to me too. I checked the DB and the old fields were still in the DB. I deleted manually and everything works fine.

Are you using MongoDB? Since it’s not a strict schema and we don’t delete the fields from the collection Strapi is returning old data. :thinking:

Can you open up a bug report on GitHub for this, although I do feel it’s slightly related to:

Deleting/Updating content-type doesn't drop/migrate the database · Issue #1114 · strapi/strapi · GitHub