Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('IndexFlowSection', () => {
`{"field1":1,"field2":{"$gt":2}}`
);
expect(optimalQueriesExamples).to.contain.text(
`{"field1":1}.sort({"field2":2})`
`{"field1":1}.sort({"field2":1})`
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const generateOptimalQueries = (
const lastFieldKey = Object.keys(lastField)[0];

// If there are only two fields, we want to show two examples
// i.e. {a:1, b: {$gt:2}} and {a:1}.sort({b: 2})
// i.e. {a:1, b: {$gt:2}} and {a:1}.sort({b: 1})
if (numOfFields === 2) {
const firstField = coveredQueriesArr[0];
const firstFieldKey = Object.keys(firstField)[0];
Expand All @@ -167,7 +167,7 @@ export const generateOptimalQueries = (
<>
{`{"${firstFieldKey}":1,"${lastFieldKey}":{"$gt":2}}`}
<br />
{`{"${firstFieldKey}":1}.sort({"${lastFieldKey}":2})`}
{`{"${firstFieldKey}":1}.sort({"${lastFieldKey}":1})`}
</>
);
}
Expand Down
Loading