I feel like what I’m looking for would be a common thing, so the fact I’m struggling to figure this out suggests I’m approaching this wrong, but… I have many items of a particular ContentType. I want to iterate all of these items to update a specific field.
For example, imagine a collection of 83 blog posts with ContentType = “post”. Imagine you update your model to include a new field named “author”. Now imagine you want to default the existing 83 posts so author = “John Doe” on all of them.
This seems a task for the CMA. The CMA documentation shows how to fetch the spaces, environments, and content types, but it does not show how to fetch all items of a specific content type.
In fact, that is how I use the CDA in my app to fetch my data items. However, getEntries() is not a method of the client in CMA. The client object returned from the CMA SDK’s contentful.createClient() looks like this: