Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
MongoDB Mongosync
/ /

Migrate Persistent Query Settings

If your source cluster uses Persistent Query Settings (PQS), you must manually migrate those settings to your destination cluster to finalize sync.

mongosync checks for PQS during initialization and the cutover process. If mongosync finds PQS on the source cluster during cutover, Mongosync shows a warning. Use the following procedure to address the warning and migrate your PQS to your destination cluster.

1

Run the following code block to output your query settings into an array:

mongosh --eval
'console.log(db.aggregate([{$querySettings:{}}]).toArray())'
2

For each query setting that you want to migrate, use setQuerySettings to apply that setting to your destination cluster.

If the query setting includes a representativeQuery field value, use that field value as the setQuerySettings value.

Otherwise, use the queryShapeHash field value from the querySettings array as the setQuerySettings value.

Back

Finalize Cutover Process

On this page