Migrating Plone 4.3 collection configuration to Plone 5.1 collection `query`?

In our migration process we dump old Plone 4.X sites via plone.restapi into a new site.

For Plone 4.X collections we need to migrate the collection criteria configuration of a collection into the query configuration of Collections in Plone 5.X.

Is there some migration code in Plone 5 that could be re-used on the Plone 4 side for generating the query data for passing it over plone.restapi into the new site?

By collections do you mean ATTopic or Collections? For the criteria of ATTopic there is a migration in plone.app.contenttypes/plone/app/contenttypes/migration/topics.py that allows you to migrate ATTopic to modern Collections. You could run that before exporting the data and then dump the query attribute of the new collections.

ATTopic - found it...I need to rip the migration apart in my case. But thanks.