How to update data fields on the server-side?

170 views Asked by At

How I write a script and update a collection field from my server?

I need to update a field of 100 users. I was wondering if I can change them from the server, instead of sending update mutations over and over?

The Queries part of Strapi Documents says:

You can just call strapi.query('modelName', 'pluginName') to access the query API for any model.

But it's not clear where to run it?

Do I need to create a plugin? or Can I create an updateUserData.js file and run node updateUserData.js?

strapi.query('user').update(  { id: 1 },...
0

There are 0 answers