| Steps To Reproduce: |
On a mongod with the following parameters set:
mongod --setParameter enableTestCommands=true --setParameter featureFlagCommonQueryFramework=true --setParameter internalQueryFrameworkControl=tryBonsai
|
Run the following:
db.coll.createIndex({a: 1});
|
db.coll.insertMany([{a: 1}, {a: 2}, {a: 2}, {a: 3}, {a: 3}, {a: 3}]);
|
|
db.runCommand({analyze: "coll", key: "a"});
|
At this point, the stats collection should be initialized correctly. Now run the following to force HistogramCE to be used:
db.adminCommand({setParameter: 1, internalQueryCardinalityEstimatorMode: "histogram"})
|
db.adminCommand({setParameter: 1, internalQueryFrameworkControl: "forceBonsai"})
|
This results in the following command failing:
db.coll.aggregate({$match: {a: 1}});
|
> Error: error: {
|
"ok" : 0,
|
"errmsg" : "Error getting histograms for path test.test : aBSON field 'StatsPath.statistics.documents' is the wrong type 'int', expected type 'long'",
|
"code" : 14,
|
"codeName" : "TypeMismatch"
|
}
|
|