Details
-
Task
-
Resolution: Works as Designed
-
Major - P3
-
None
-
None
-
None
-
None
-
Query Execution
-
QE 2023-02-20, QE 2023-03-06, QE 2023-03-20, QE 2023-04-03, QE 2023-04-17
Description
The latest server release has changed what output is generated in createIndexes command:
In previous releases (for example in 5.0.2) fields in output used a format with "boolean flag" like: `"_id" : true`. See wildcardProjection node:
MongoDB Enterprise replset:PRIMARY> db.runCommand({ "createIndexes" : "test_wildcard_index", "indexes" : [{ "key" : { "$**" : 1 }, "name" : "custom", "wildcardProjection" : { "b" : 1, "_id" : 0 } }] }) |
{
|
"numIndexesBefore" : 1, |
"numIndexesAfter" : 2, |
"createdCollectionAutomatically" : true, |
"commitQuorum" : "votingMembers", |
"ok" : 1, |
"$clusterTime" : { |
"clusterTime" : Timestamp(1674661581, 2), |
"signature" : { |
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), |
"keyId" : NumberLong(0) |
}
|
},
|
"operationTime" : Timestamp(1674661581, 2) |
}
|
MongoDB Enterprise replset:PRIMARY> db.test_wildcard_index.getIndexes()
|
[
|
{
|
"v" : 2, |
"key" : { |
"_id" : 1 |
},
|
"name" : "_id_" |
},
|
{
|
"v" : 2, |
"key" : { |
"$**" : 1 |
},
|
"name" : "custom", |
"wildcardProjection" : { |
"b" : true, |
"_id" : false |
}
|
}
|
]
|
but in the recently released version the output uses a format with "a number flag" like `"_id" : 0`. See wildcardProjection node in output for 6.3.0-alpha-1336-gd798eac server:
MongoDB Enterprise replset:PRIMARY> db.runCommand({ "createIndexes" : "test_wildcard_index", "indexes" : [{ "key" : { "$**" : 1 }, "name" : "custom", "wildcardProjection" : { "b" : 1, "_id" : 0 } }] }) |
{
|
"numIndexesBefore" : 1, |
"numIndexesAfter" : 2, |
"createdCollectionAutomatically" : true, |
"commitQuorum" : "votingMembers", |
"ok" : 1, |
"$clusterTime" : { |
"clusterTime" : Timestamp(1674660265, 2), |
"signature" : { |
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), |
"keyId" : NumberLong(0) |
}
|
},
|
"operationTime" : Timestamp(1674660265, 2) |
}
|
MongoDB Enterprise replset:PRIMARY> db.test_wildcard_index.getIndexes()
|
[
|
{
|
"v" : 2, |
"key" : { |
"_id" : 1 |
},
|
"name" : "_id_" |
},
|
{
|
"v" : 2, |
"key" : { |
"$**" : 1 |
},
|
"name" : "custom", |
"wildcardProjection" : { |
"b" : 1, |
"_id" : 0 |
}
|
}
|
]
|
As I recall, the newly added format (with a number flag) was used in servers before 4.5 and then was replaced on a format with boolean flag. So now the previous format got back? Can someone clarify it?
Attachments
Issue Links
- is depended on by
-
RUBY-3216 Wildcard projection spec fails on latest
-
- Closed
-
- is related to
-
SERVER-67446 Ensure consistent wildcardProjection and columnstoreProjection specs in catalog
-
- Closed
-