feat: Increase required minimum MongoDB version to 7.0.16 (#9971)
BREAKING CHANGE: This releases increases the required minimum MongoDB version to `7.0.16`.
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -153,10 +153,6 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: MongoDB 6, ReplicaSet
|
|
||||||
MONGODB_VERSION: 6.0.19
|
|
||||||
MONGODB_TOPOLOGY: replset
|
|
||||||
NODE_VERSION: 24.11.0
|
|
||||||
- name: MongoDB 7, ReplicaSet
|
- name: MongoDB 7, ReplicaSet
|
||||||
MONGODB_VERSION: 7.0.16
|
MONGODB_VERSION: 7.0.16
|
||||||
MONGODB_TOPOLOGY: replset
|
MONGODB_TOPOLOGY: replset
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
[](https://github.com/parse-community/parse-dashboard/releases)
|
[](https://github.com/parse-community/parse-dashboard/releases)
|
||||||
|
|
||||||
[](https://nodejs.org)
|
[](https://nodejs.org)
|
||||||
[](https://www.mongodb.com)
|
[](https://www.mongodb.com)
|
||||||
[](https://www.postgresql.org)
|
[](https://www.postgresql.org)
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/parse-server)
|
[](https://www.npmjs.com/package/parse-server)
|
||||||
|
|||||||
@@ -123,7 +123,6 @@
|
|||||||
"build:types": "tsc",
|
"build:types": "tsc",
|
||||||
"watch": "babel --watch src/ -d lib/ --copy-files",
|
"watch": "babel --watch src/ -d lib/ --copy-files",
|
||||||
"watch:ts": "tsc --watch",
|
"watch:ts": "tsc --watch",
|
||||||
"test:mongodb:6.0.19": "MONGODB_VERSION=6.0.19 npm run test",
|
|
||||||
"test:mongodb:7.0.16": "MONGODB_VERSION=7.0.16 npm run test",
|
"test:mongodb:7.0.16": "MONGODB_VERSION=7.0.16 npm run test",
|
||||||
"test:mongodb:8.0.4": "MONGODB_VERSION=8.0.4 npm run test",
|
"test:mongodb:8.0.4": "MONGODB_VERSION=8.0.4 npm run test",
|
||||||
"test:postgres:testonly": "cross-env PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly",
|
"test:postgres:testonly": "cross-env PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly",
|
||||||
|
|||||||
@@ -79,30 +79,6 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it_only_mongodb_version('<7')('query aggregate with hint string', async () => {
|
|
||||||
const object = new TestObject({ foo: 'bar' });
|
|
||||||
await object.save();
|
|
||||||
|
|
||||||
const collection = await config.database.adapter._adaptiveCollection('TestObject');
|
|
||||||
let result = await collection.aggregate([{ $group: { _id: '$foo' } }], {
|
|
||||||
explain: true,
|
|
||||||
});
|
|
||||||
let queryPlanner = result[0].stages[0].$cursor.queryPlanner;
|
|
||||||
expect(queryPlanner.winningPlan.stage).toBe('PROJECTION_SIMPLE');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.stage).toBe('COLLSCAN');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage).toBeUndefined();
|
|
||||||
|
|
||||||
result = await collection.aggregate([{ $group: { _id: '$foo' } }], {
|
|
||||||
hint: '_id_',
|
|
||||||
explain: true,
|
|
||||||
});
|
|
||||||
queryPlanner = result[0].stages[0].$cursor.queryPlanner;
|
|
||||||
expect(queryPlanner.winningPlan.stage).toBe('PROJECTION_SIMPLE');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.stage).toBe('FETCH');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.stage).toBe('IXSCAN');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_');
|
|
||||||
});
|
|
||||||
|
|
||||||
it_only_mongodb_version('>=7')('query aggregate with hint string', async () => {
|
it_only_mongodb_version('>=7')('query aggregate with hint string', async () => {
|
||||||
const object = new TestObject({ foo: 'bar' });
|
const object = new TestObject({ foo: 'bar' });
|
||||||
await object.save();
|
await object.save();
|
||||||
@@ -127,31 +103,6 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
|||||||
expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_');
|
expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_');
|
||||||
});
|
});
|
||||||
|
|
||||||
it_only_mongodb_version('<7')('query aggregate with hint object', async () => {
|
|
||||||
const object = new TestObject({ foo: 'bar' });
|
|
||||||
await object.save();
|
|
||||||
|
|
||||||
const collection = await config.database.adapter._adaptiveCollection('TestObject');
|
|
||||||
let result = await collection.aggregate([{ $group: { _id: '$foo' } }], {
|
|
||||||
explain: true,
|
|
||||||
});
|
|
||||||
let queryPlanner = result[0].stages[0].$cursor.queryPlanner;
|
|
||||||
expect(queryPlanner.winningPlan.stage).toBe('PROJECTION_SIMPLE');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.stage).toBe('COLLSCAN');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage).toBeUndefined();
|
|
||||||
|
|
||||||
result = await collection.aggregate([{ $group: { _id: '$foo' } }], {
|
|
||||||
hint: { _id: 1 },
|
|
||||||
explain: true,
|
|
||||||
});
|
|
||||||
queryPlanner = result[0].stages[0].$cursor.queryPlanner;
|
|
||||||
expect(queryPlanner.winningPlan.stage).toBe('PROJECTION_SIMPLE');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.stage).toBe('FETCH');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.stage).toBe('IXSCAN');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 });
|
|
||||||
});
|
|
||||||
|
|
||||||
it_only_mongodb_version('>=7')('query aggregate with hint object', async () => {
|
it_only_mongodb_version('>=7')('query aggregate with hint object', async () => {
|
||||||
const object = new TestObject({ foo: 'bar' });
|
const object = new TestObject({ foo: 'bar' });
|
||||||
await object.save();
|
await object.save();
|
||||||
@@ -202,39 +153,6 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
|||||||
expect(explain.queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_');
|
expect(explain.queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_');
|
||||||
});
|
});
|
||||||
|
|
||||||
it_only_mongodb_version('<7')('query aggregate with hint (rest)', async () => {
|
|
||||||
const object = new TestObject({ foo: 'bar' });
|
|
||||||
await object.save();
|
|
||||||
let options = Object.assign({}, masterKeyOptions, {
|
|
||||||
url: Parse.serverURL + '/aggregate/TestObject',
|
|
||||||
qs: {
|
|
||||||
explain: true,
|
|
||||||
$group: JSON.stringify({ _id: '$foo' }),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
let response = await request(options);
|
|
||||||
let queryPlanner = response.data.results[0].stages[0].$cursor.queryPlanner;
|
|
||||||
expect(queryPlanner.winningPlan.stage).toBe('PROJECTION_SIMPLE');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.stage).toBe('COLLSCAN');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage).toBeUndefined();
|
|
||||||
|
|
||||||
options = Object.assign({}, masterKeyOptions, {
|
|
||||||
url: Parse.serverURL + '/aggregate/TestObject',
|
|
||||||
qs: {
|
|
||||||
explain: true,
|
|
||||||
hint: '_id_',
|
|
||||||
$group: JSON.stringify({ _id: '$foo' }),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
response = await request(options);
|
|
||||||
queryPlanner = response.data.results[0].stages[0].$cursor.queryPlanner;
|
|
||||||
expect(queryPlanner.winningPlan.stage).toBe('PROJECTION_SIMPLE');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.stage).toBe('FETCH');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.stage).toBe('IXSCAN');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_');
|
|
||||||
expect(queryPlanner.winningPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 });
|
|
||||||
});
|
|
||||||
|
|
||||||
it_only_mongodb_version('>=7')('query aggregate with hint (rest)', async () => {
|
it_only_mongodb_version('>=7')('query aggregate with hint (rest)', async () => {
|
||||||
const object = new TestObject({ foo: 'bar' });
|
const object = new TestObject({ foo: 'bar' });
|
||||||
await object.save();
|
await object.save();
|
||||||
|
|||||||
Reference in New Issue
Block a user