Bulk update default value for new field in collection

System Information
  • Strapi Version: 4
  • Operating System: Mac
  • Database: PostgreSQL
  • Node Version: 18

I have a Strapi v4 app using a PostgreSQL database in production.

My app has a collection called: places.

Initially I created the collection with fields: title, description, image etc.

I’ve now found that I also need a slugfield which uses the UID datatype.

After creating it, it “magically” adds a slug to every new instance of places created by users or directly in the admin panel.

But I can’t figure out how to update the existing ~200 places. I know there isn’t a bulk update option but does anyone have a decent way to do this without going through each manually?

You can use the api and write a script that for uses a filter and loops over all of them that don’t have one

That’s what I was afraid of, sadly my app data isn’t as accessible as that.
Any added places get added to a list of things to be moderated so I’d need to make a plugin on the admin side to do this to bypass moderation and then manually generate the UID right?

You can generate an API token with what the app will be accessable with that for everyone who as the token as long as they know the adress of your strapi server