mongodb-explain-compat 3.0.1 → 3.0.3

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.
Files changed (2) hide show
  1. package/lib/index.js +7 -5
  2. package/package.json +6 -4
package/lib/index.js CHANGED
@@ -175,7 +175,7 @@ function mapShardedFind(explain) {
175
175
  }
176
176
  queryPlanner.winningPlan.shards.forEach((shard, index) => {
177
177
  const winningPlan = shard.winningPlan.queryPlan;
178
- if (winningPlan) {
178
+ if (winningPlan && executionStats) {
179
179
  const executionStages = mapStages(
180
180
  winningPlan,
181
181
  executionStats.executionStages.shards[index].executionStages
@@ -204,10 +204,12 @@ function _mapPlannerStage(planner) {
204
204
  const winningPlan = planner.queryPlanner.winningPlan.queryPlan;
205
205
  planner.queryPlanner.winningPlan = winningPlan;
206
206
 
207
- planner.executionStats.executionStages = mapStages(
208
- winningPlan,
209
- planner.executionStats.executionStages
210
- );
207
+ if (planner.executionStats) {
208
+ planner.executionStats.executionStages = mapStages(
209
+ winningPlan,
210
+ planner.executionStats.executionStages
211
+ );
212
+ }
211
213
  }
212
214
  return planner;
213
215
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mongodb-explain-compat",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Convert mongodb SBE explain output to 4.4 explain output",
5
5
  "keywords": [
6
6
  "mongodb",
@@ -25,12 +25,14 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "lint": "eslint **/*.js",
28
- "test": "npm run lint && npm run compile && nyc mocha --colors test/*.js",
28
+ "test": "npm run compile && nyc mocha --colors test/*.js",
29
29
  "compile": "gen-esm-wrapper . ./.esm-wrapper.mjs",
30
30
  "prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
31
31
  "test-ci": "npm run test",
32
32
  "depcheck": "depcheck",
33
- "bootstrap": "npm run compile"
33
+ "bootstrap": "npm run compile",
34
+ "check": "npm run lint && npm run depcheck",
35
+ "check-ci": "npm run check"
34
36
  },
35
37
  "homepage": "https://github.com/mongodb-js/compass",
36
38
  "repository": {
@@ -54,5 +56,5 @@
54
56
  "mocha": "^10.2.0",
55
57
  "nyc": "^15.1.0"
56
58
  },
57
- "gitHead": "e4f2643a437ce2407657a63246e303d13ce8297b"
59
+ "gitHead": "aabc5be9049177a56c831354535e073bf77cb16f"
58
60
  }