|
| 1 | +ref: 3.4-downgrade-feature-compatibility |
| 2 | +content: | |
| 3 | +
|
| 4 | + Downgrade the ``featureCompatibilityVersion`` to ``"3.2"``. |
| 5 | +
|
| 6 | + .. code-block:: javascript |
| 7 | +
|
| 8 | + db.adminCommand({setFeatureCompatibilityVersion: "3.2"}) |
| 9 | +
|
| 10 | + This command must perform writes to an internal system collection. |
| 11 | + If for any reason the command does not complete successfully, you |
| 12 | + can safely retry the command on the |target| as the operation is |
| 13 | + idempotent. |
| 14 | +--- |
| 15 | +ref: 3.4-downgrade-views |
| 16 | +content: | |
| 17 | +
|
| 18 | + To find views, you can run the following in the :program:`mongo` shell: |
| 19 | +
|
| 20 | + .. code-block:: javascript |
| 21 | +
|
| 22 | + db.adminCommand("listDatabases").databases.forEach(function(d){ |
| 23 | + let mdb = db.getSiblingDB(d.name); |
| 24 | + mdb.getCollectionInfos({type: "view"}).forEach(function(c){ |
| 25 | + print(mdb[c.name]); |
| 26 | + }); |
| 27 | + }); |
| 28 | +
|
| 29 | + In each database that contains views, drop the ``system.views`` |
| 30 | + collection to drop all views in that database. |
| 31 | + |
| 32 | +--- |
| 33 | +ref: 3.4-downgrade-collation-collections |
| 34 | +content: | |
| 35 | +
|
| 36 | + To find collections with collation specifications, you can run the |
| 37 | + following in the :program:`mongo` shell: |
| 38 | +
|
| 39 | + .. code-block:: javascript |
| 40 | +
|
| 41 | + db.adminCommand("listDatabases").databases.forEach(function(d){ |
| 42 | + let mdb = db.getSiblingDB(d.name); |
| 43 | + mdb.getCollectionInfos( { "options.collation": { $exists: true } } ).forEach(function(c){ |
| 44 | + print(mdb[c.name]); |
| 45 | + }); |
| 46 | + }); |
| 47 | +
|
| 48 | + You can migrate the content of the collection to a new collection |
| 49 | + without the collation specification (one way is via the |
| 50 | + aggregation pipeline stage :pipeline:`$out`). |
| 51 | +--- |
| 52 | +ref: 3.4-downgrade-collation-indexes |
| 53 | +content: | |
| 54 | + |
| 55 | + To find indexes with collation specification, you can run the |
| 56 | + following in the :program:`mongo` shell: |
| 57 | +
|
| 58 | + .. code-block:: javascript |
| 59 | +
|
| 60 | + db.adminCommand("listDatabases").databases.forEach(function(d){ |
| 61 | + let mdb = db.getSiblingDB(d.name); |
| 62 | + mdb.getCollectionInfos().forEach(function(c){ |
| 63 | + let currentCollection = mdb.getCollection(c.name); |
| 64 | + currentCollection.getIndexes().forEach(function(i){ |
| 65 | + if (i.collation){ |
| 66 | + printjson(i); |
| 67 | + } |
| 68 | + }); |
| 69 | + }); |
| 70 | + }); |
| 71 | +
|
| 72 | + Drop the indexes with a collation specification. After the downgrade, |
| 73 | + recreate the dropped indexes. |
| 74 | +--- |
| 75 | +ref: 3.4-downgrade-v2-indexes |
| 76 | +content: | |
| 77 | +
|
| 78 | + To find indexes with ``v: 2``, you can run the following in the |
| 79 | + :program:`mongo` shell: |
| 80 | +
|
| 81 | + .. code-block:: javascript |
| 82 | +
|
| 83 | + db.adminCommand("listDatabases").databases.forEach(function(d){ |
| 84 | + let mdb = db.getSiblingDB(d.name); |
| 85 | + mdb.getCollectionInfos().forEach(function(c){ |
| 86 | + let currentCollection = mdb.getCollection(c.name); |
| 87 | + currentCollection.getIndexes().forEach(function(i){ |
| 88 | + if (i.v === 2){ |
| 89 | + printjson(i); |
| 90 | + } |
| 91 | + }); |
| 92 | + }); |
| 93 | + }); |
| 94 | + |
| 95 | +--- |
| 96 | +ref: 3.4-downgrade-decimal |
| 97 | +content: | |
| 98 | +
|
| 99 | + Convert any data of :ref:`decimal <3.4-decimal>` type. In versions |
| 100 | + of MongoDB earlier than 3.4, operations against documents that |
| 101 | + contain :ref:`decimal <3.4-decimal>` type may fail. For some |
| 102 | + possible conversion options, see |
| 103 | + :doc:`/tutorial/model-monetary-data`. |
| 104 | +
|
| 105 | + To detect the presence of decimal, you can run |
| 106 | + :method:`db.collection.validate(true) <db.collection.validate()>` |
| 107 | + against the collections which may contain decimal data. |
| 108 | +
|
| 109 | + :method:`db.collection.validate(true) <db.collection.validate()>` |
| 110 | + reports on decimal data only when ``featureCompatibilityVersion`` is |
| 111 | + ``"3.2"``. |
| 112 | +
|
| 113 | +... |
0 commit comments