Skip to content

Commit 196abf9

Browse files
authored
COMPASS-1190: Backport COMPASS 1144 default sort should be null (#1009)
* COMPASS-1190: Backport COMPASS 1144 Allow modifying or disabling the default sort for explains (#1008) * set default sort to null * retrieve sidebar database count on data service connect * expect index usage to be at least 0 This seems to be a repeat error here where it index usage could be 0. * Fix ChartStoreIntegrationTest Note: It was removed from master. * Resolve 'renders the index usages' test on MongoDB 3.4+ This was changed to 'at least' in master, but a quick fix for 1.7 should be enough.
1 parent b742fe1 commit 196abf9

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/internal-packages/query/lib/store/query-store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const RESET_STATE = 'reset';
2020
const APPLY_STATE = 'apply';
2121

2222
const DEFAULT_FILTER = {};
23-
const DEFAULT_SORT = { _id: 1 };
23+
const DEFAULT_SORT = null;
2424
const DEFAULT_LIMIT = 0;
2525
const DEFAULT_SKIP = 0;
2626
const DEFAULT_PROJECT = null;

test/functional/compass-functional.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ describe('Compass Main Functional Test Suite #spectron', function() {
699699
.getIndexUsages()
700700
.should
701701
.eventually
702-
.equal(isIndexUsageEnabled(serverVersion) ? '8' : '0');
702+
.equal(isIndexUsageEnabled(serverVersion) ? '4' : '0');
703703
});
704704

705705
it('renders the index properties', function() {

test/renderer/chart.store.integration.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('ChartStoreIntegration', function() {
4848
const QUERY = {filter: {foo: 1}};
4949
const EXPECTED = Object.assign({}, {
5050
project: null,
51-
sort: {_id: 1},
51+
sort: null,
5252
skip: 0,
5353
limit: 0,
5454
ns: '',

test/unit/query-changed-store.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('QueryChangedStore', () => {
5757
it('contains all the other query options', (done) => {
5858
unsubscribe = QueryChangedStore.listen((state) => {
5959
expect(state.filter).to.be.deep.equal({foo: 1});
60-
expect(state.sort).to.be.deep.equal({_id: 1});
60+
expect(state.sort).to.be.deep.equal(null);
6161
expect(state.skip).to.be.equal(0);
6262
expect(state.limit).to.be.equal(0);
6363
expect(state.project).to.be.deep.equal(null);

test/unit/query-store.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ describe('QueryStore', () => {
452452
unsubscribe = QueryStore.listen((state) => {
453453
expect(state.sortString).to.be.equal('{"sort": null}');
454454
expect(state.sortValid).to.be.false;
455-
expect(state.sort).to.deep.equal({_id: 1});
455+
expect(state.sort).to.deep.equal(null);
456456
done();
457457
});
458458
QueryStore.setQueryString('sort', '{"sort": null}');

0 commit comments

Comments
 (0)