Skip to content

Commit 9633a62

Browse files
github-actions[bot]dblythy
authored andcommitted
feat: add MongoDB 5.1 compatibility (parse-community#7682)
1 parent 31afbbb commit 9633a62

File tree

5 files changed

+75
-183
lines changed

5 files changed

+75
-183
lines changed

.github/workflows/ci.yml

+30-24
Original file line numberDiff line numberDiff line change
@@ -142,30 +142,36 @@ jobs:
142142
strategy:
143143
matrix:
144144
include:
145-
- name: MongoDB 4.2, ReplicaSet
146-
MONGODB_VERSION: 4.2.25
147-
MONGODB_TOPOLOGY: replset
148-
NODE_VERSION: 22.4.1
149-
- name: MongoDB 4.4, ReplicaSet
150-
MONGODB_VERSION: 4.4.29
151-
MONGODB_TOPOLOGY: replset
152-
NODE_VERSION: 22.4.1
153-
- name: MongoDB 5, ReplicaSet
154-
MONGODB_VERSION: 5.0.26
155-
MONGODB_TOPOLOGY: replset
156-
NODE_VERSION: 22.4.1
157-
- name: MongoDB 6, ReplicaSet
158-
MONGODB_VERSION: 6.0.14
159-
MONGODB_TOPOLOGY: replset
160-
NODE_VERSION: 22.4.1
161-
- name: MongoDB 7, ReplicaSet
162-
MONGODB_VERSION: 7.0.8
163-
MONGODB_TOPOLOGY: replset
164-
NODE_VERSION: 22.4.1
165-
- name: MongoDB 8, ReplicaSet
166-
MONGODB_VERSION: 8.0.0
167-
MONGODB_TOPOLOGY: replset
168-
NODE_VERSION: 22.4.1
145+
- name: MongoDB 5.1, ReplicaSet, WiredTiger
146+
MONGODB_VERSION: 5.1.0
147+
MONGODB_TOPOLOGY: replicaset
148+
MONGODB_STORAGE_ENGINE: wiredTiger
149+
NODE_VERSION: 14.18.1
150+
- name: MongoDB 5.0, ReplicaSet, WiredTiger
151+
MONGODB_VERSION: 5.0.3
152+
MONGODB_TOPOLOGY: replicaset
153+
MONGODB_STORAGE_ENGINE: wiredTiger
154+
NODE_VERSION: 16.13.0
155+
- name: MongoDB 4.4, ReplicaSet, WiredTiger
156+
MONGODB_VERSION: 4.4.10
157+
MONGODB_TOPOLOGY: replicaset
158+
MONGODB_STORAGE_ENGINE: wiredTiger
159+
NODE_VERSION: 16.13.0
160+
- name: MongoDB 4.2, ReplicaSet, WiredTiger
161+
MONGODB_VERSION: 4.2.17
162+
MONGODB_TOPOLOGY: replicaset
163+
MONGODB_STORAGE_ENGINE: wiredTiger
164+
NODE_VERSION: 16.13.0
165+
- name: MongoDB 4.0, ReplicaSet, WiredTiger
166+
MONGODB_VERSION: 4.0.27
167+
MONGODB_TOPOLOGY: replicaset
168+
MONGODB_STORAGE_ENGINE: wiredTiger
169+
NODE_VERSION: 16.13.0
170+
- name: MongoDB 4.0, Standalone, MMAPv1
171+
MONGODB_VERSION: 4.0.27
172+
MONGODB_TOPOLOGY: standalone
173+
MONGODB_STORAGE_ENGINE: mmapv1
174+
NODE_VERSION: 16.13.0
169175
- name: Redis Cache
170176
PARSE_SERVER_TEST_CACHE: redis
171177
MONGODB_VERSION: 8.0.0

README.md

+19-24
Original file line numberDiff line numberDiff line change
@@ -127,36 +127,31 @@ Before you start make sure you have installed:
127127

128128
Parse Server is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the [Node.js Long Term Support plan](https://github.com/nodejs/Release) and only test against versions that are officially supported and have not reached their end-of-life date.
129129

130-
| Version | Latest Version | End-of-Life | Compatible |
131-
|------------|----------------|-------------|------------|
132-
| Node.js 18 | 18.20.4 | April 2025 | ✅ Yes |
133-
| Node.js 20 | 20.15.1 | April 2026 | ✅ Yes |
134-
| Node.js 22 | 22.4.1 | April 2027 | ✅ Yes |
130+
| Version | Latest Version | End-of-Life | Compatible |
131+
|------------|----------------|-------------|--------------|
132+
| Node.js 12 | 12.22.7 | April 2022 | ✅ Yes |
133+
| Node.js 14 | 14.18.1 | April 2023 | ✅ Yes |
134+
| Node.js 16 | 16.13.0 | April 2024 | ✅ Yes |
135+
| Node.js 17 | 17.x | June 2022 | ❌ Not tested |
135136

136137
#### MongoDB
137138

138-
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and [MongoDB lifecycle schedule](https://www.mongodb.com/support-policy/lifecycles) and only test against versions that are officially supported and have not reached their end-of-life date. MongoDB "rapid releases" are ignored as these are considered pre-releases of the next major version.
139-
140-
| Version | Latest Version | End-of-Life | Compatible |
141-
|-------------|----------------|---------------|------------|
142-
| MongoDB 4.2 | 4.2.25 | April 2023 | ✅ Yes |
143-
| MongoDB 4.4 | 4.4.29 | February 2024 | ✅ Yes |
144-
| MongoDB 5 | 5.0.26 | October 2024 | ✅ Yes |
145-
| MongoDB 6 | 6.0.14 | July 2025 | ✅ Yes |
146-
| MongoDB 7 | 7.0.8 | TDB | ✅ Yes |
147-
| MongoDB 8 | 8.0.0 | TDB | ✅ Yes |
139+
| Version | Latest Version | End-of-Life | Compatible |
140+
|-------------|----------------|--------------|------------|
141+
| MongoDB 4.0 | 4.0.27 | April 2022 | ✅ Yes |
142+
| MongoDB 4.2 | 4.2.17 | TBD | ✅ Yes |
143+
| MongoDB 4.4 | 4.4.10 | TBD | ✅ Yes |
144+
| MongoDB 5.0 | 5.0.3 | January 2024 | ✅ Yes |
145+
| MongoDB 5.1 | 5.1.0 | January 2024 | ✅ Yes |
148146

149147
#### PostgreSQL
150148

151-
Parse Server is continuously tested with the most recent releases of PostgreSQL and PostGIS to ensure compatibility, using [PostGIS docker images](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&ordering=last_updated). We follow the [PostgreSQL support schedule](https://www.postgresql.org/support/versioning) and [PostGIS support schedule](https://www.postgis.net/eol_policy/) and only test against versions that are officially supported and have not reached their end-of-life date. Due to the extensive PostgreSQL support duration of 5 years, Parse Server drops support about 2 years before the official end-of-life date.
152-
153-
| Version | PostGIS Version | End-of-Life | Parse Server Support | Compatible |
154-
|-------------|--------------------|---------------|----------------------|------------|
155-
| Postgres 13 | 3.1, 3.2, 3.3, 3.4, 3.5 | November 2025 | <= 6.x (2023) | ✅ Yes |
156-
| Postgres 14 | 3.5 | November 2026 | <= 7.x (2024) | ✅ Yes |
157-
| Postgres 15 | 3.5 | November 2027 | <= 8.x (2025) | ✅ Yes |
158-
| Postgres 16 | 3.5 | November 2028 | <= 9.x (2026) | ✅ Yes |
159-
| Postgres 17 | 3.5 | November 2029 | <= 9.x (2026) | ✅ Yes |
149+
| Version | PostGIS Version | End-of-Life | Parse Server Support End | Compatible |
150+
|-------------|-----------------|---------------|--------------------------|------------|
151+
| Postgres 11 | 3.0, 3.1, 3.2 | November 2023 | April 2022 | ✅ Yes |
152+
| Postgres 12 | 3.2 | November 2024 | April 2023 | ✅ Yes |
153+
| Postgres 13 | 3.2 | November 2025 | April 2024 | ✅ Yes |
154+
| Postgres 14 | 3.2 | November 2026 | April 2025 | ✅ Yes |
160155

161156
### Locally
162157

package.json

+10-11
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,17 @@
121121
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017",
122122
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
123123
"test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion",
124-
"test:mongodb:4.2.19": "npm run test:mongodb --dbversion=4.2.19",
125-
"test:mongodb:4.4.13": "npm run test:mongodb --dbversion=4.4.13",
126-
"test:mongodb:5.3.2": "npm run test:mongodb --dbversion=5.3.2",
127-
"test:mongodb:6.0.2": "npm run test:mongodb --dbversion=6.0.2",
128-
"test:mongodb:7.0.1": "npm run test:mongodb --dbversion=7.0.1",
129-
"test:mongodb:8.0.3": "npm run test:mongodb --dbversion=8.0.3",
130-
"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",
131-
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017",
132-
"testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
124+
"test:mongodb:4.0.27": "npm run test:mongodb --dbversion=4.0.27",
125+
"test:mongodb:4.2.17": "npm run test:mongodb --dbversion=4.2.17",
126+
"test:mongodb:4.4.10": "npm run test:mongodb --dbversion=4.4.10",
127+
"test:mongodb:5.0.5": "npm run test:mongodb --dbversion=5.0.5",
128+
"test:mongodb:5.1.0": "npm run test:mongodb --dbversion=5.1.0",
129+
"posttest:mongodb": "mongodb-runner stop",
130+
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.1.0} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",
131+
"testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.1.0} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine",
133132
"test": "npm run testonly",
134-
"posttest": "cross-env mongodb-runner stop --all",
135-
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine",
133+
"posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.1.0} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner stop",
134+
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.1.0} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 nyc jasmine",
136135
"start": "node ./bin/parse-server",
137136
"prettier": "prettier --write {src,spec}/{**/*,*}.js",
138137
"prepare": "npm run build",

spec/MongoStorageAdapter.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
390390
await expectAsync(adapter.getClass('UnknownClass')).toBeRejectedWith(undefined);
391391
});
392392

393-
it_only_mongodb_version('<5.1 || >=6')('should use index for caseInsensitive query', async () => {
393+
it_only_mongodb_version('<5.1')('should use index for caseInsensitive query', async () => {
394394
const user = new Parse.User();
395395
user.set('username', 'Bugs');
396396
user.set('password', 'Bunny');
@@ -424,7 +424,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
424424
expect(postIndexPlan.executionStats.executionStages.stage).toBe('FETCH');
425425
});
426426

427-
it_only_mongodb_version('>=5.1 <6')('should use index for caseInsensitive query', async () => {
427+
it_only_mongodb_version('>=5.1')('should use index for caseInsensitive query', async () => {
428428
const user = new Parse.User();
429429
user.set('username', 'Bugs');
430430
user.set('password', 'Bunny');

0 commit comments

Comments
 (0)