Skip to content

Commit 74cb902

Browse files
committed
fix explain
1 parent 865e323 commit 74cb902

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

spec/MongoStorageAdapter.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
338338
{ username: 'bugs' },
339339
{ caseInsensitive: true, explain: true }
340340
);
341-
expect(preIndexPlan.executionStats.executionStages.stage).toBe('COLLSCAN');
342-
expect(postIndexPlan.executionStats.executionStages.stage).toBe('FETCH');
341+
expect(preIndexPlan[0].executionStats.executionStages.stage).toBe('COLLSCAN');
342+
expect(postIndexPlan[0].executionStats.executionStages.stage).toBe('FETCH');
343343
});
344344

345345
it('should delete field without index', async () => {

spec/ParseQuery.hint.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe_only_db('mongo')('Parse.Query hint', () => {
163163
},
164164
});
165165
response = await request(options);
166-
explain = response.data.results;
166+
explain = response.data.results[0];
167167
expect(explain.queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_');
168168
});
169169

spec/ParseQuery.spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5214,8 +5214,11 @@ describe('Parse.Query testing', () => {
52145214
const query = new Parse.Query('_User');
52155215
query.equalTo('objectId', user.id);
52165216
query.explain();
5217-
const result = await query.find();
5218-
// Validate
5217+
//First
5218+
const result = await query.first();
52195219
expect(result.executionStats).not.toBeUndefined();
5220+
//Find
5221+
const results = await query.find();
5222+
expect(results[0].executionStats).not.toBeUndefined();
52205223
});
52215224
});

0 commit comments

Comments
 (0)