mongodb-explain-compat 2.9.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.esm-wrapper.mjs +4 -0
- package/lib/index.js +8 -2
- package/package.json +4 -4
package/.esm-wrapper.mjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import mod from "./lib/index.js";
|
|
2
2
|
|
|
3
3
|
export default mod;
|
|
4
|
+
export const getStageCursorKey = mod.getStageCursorKey;
|
|
5
|
+
export const isAggregationExplain = mod.isAggregationExplain;
|
|
6
|
+
export const isShardedAggregationExplain = mod.isShardedAggregationExplain;
|
|
7
|
+
export const isShardedFindExplain = mod.isShardedFindExplain;
|
package/lib/index.js
CHANGED
|
@@ -87,7 +87,7 @@ function isShardedAggregationExplain(explain) {
|
|
|
87
87
|
return !!explain.shards;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
function
|
|
90
|
+
function isShardedFindExplain(explain) {
|
|
91
91
|
const { mongosPlannerVersion } = explain.queryPlanner ?? {};
|
|
92
92
|
return !isNaN(mongosPlannerVersion);
|
|
93
93
|
}
|
|
@@ -126,7 +126,7 @@ module.exports = function (explain) {
|
|
|
126
126
|
explain = mapUnshardedAggregation(explain);
|
|
127
127
|
}
|
|
128
128
|
} else {
|
|
129
|
-
if (
|
|
129
|
+
if (isShardedFindExplain(explain)) {
|
|
130
130
|
explain = mapShardedFind(explain);
|
|
131
131
|
} else {
|
|
132
132
|
explain = mapUnshardedFind(explain);
|
|
@@ -211,3 +211,9 @@ function _mapPlannerStage(planner) {
|
|
|
211
211
|
}
|
|
212
212
|
return planner;
|
|
213
213
|
}
|
|
214
|
+
|
|
215
|
+
module.exports.getStageCursorKey = getStageCursorKey;
|
|
216
|
+
|
|
217
|
+
module.exports.isAggregationExplain = isAggregationExplain;
|
|
218
|
+
module.exports.isShardedAggregationExplain = isShardedAggregationExplain;
|
|
219
|
+
module.exports.isShardedFindExplain = isShardedFindExplain;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodb-explain-compat",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Convert mongodb SBE explain output to 4.4 explain output",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mongodb",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"main": "lib/index.js",
|
|
11
11
|
"compass:main": "lib/index.js",
|
|
12
12
|
"exports": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"import": "./.esm-wrapper.mjs",
|
|
14
|
+
"require": "./lib/index.js"
|
|
15
15
|
},
|
|
16
16
|
"compass:exports": {
|
|
17
17
|
".": "./lib/index.js"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"mocha": "^8.1.3",
|
|
55
55
|
"nyc": "^15.1.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "a30734888ab496a07d58e26870e5e33b374e98f7"
|
|
58
58
|
}
|