Skip to content

Commit

Permalink
added optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
malikj2000 committed Jun 28, 2023
1 parent 074d075 commit 2439c8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/integration/crud/explain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {

const explain = [true, false, 'queryPlanner', 'allPlansExecution', 'executionStats', 'invalid'];

describe('CRUD API explain option', function () {
describe.only('CRUD API explain option', function () {
let client: MongoClient;
let db: Db;
let collection: Collection;
Expand Down Expand Up @@ -86,7 +86,8 @@ describe('CRUD API explain option', function () {
let explainDocument;
if (name === 'aggregate' && explainValue !== 'invalid') {
// value changes depending on server version
explainDocument = response[0].stages[0].$cursor ?? response[0].stages[0] ?? response[0];
explainDocument =
response[0].stages?.[0]?.$cursor ?? response[0]?.stages ?? response[0];
} else {
explainDocument = response;
}
Expand Down

0 comments on commit 2439c8c

Please sign in to comment.