Skip to content

Commit 37245f6

Browse files
authored
feat: Remove support for MongoDB 4.0 (#8292)
BREAKING CHANGE: This release removes support for MongoDB 4.0; the new minimum supported MongoDB version is 4.2. which also removes support for the deprecated MongoDB MMAPv1 storage engine
1 parent ccb1497 commit 37245f6

File tree

5 files changed

+16
-53
lines changed

5 files changed

+16
-53
lines changed

.github/workflows/ci.yml

+5-22
Original file line numberDiff line numberDiff line change
@@ -121,51 +121,34 @@ jobs:
121121
strategy:
122122
matrix:
123123
include:
124-
- name: MongoDB 4.0, Standalone, MMAPv1
125-
MONGODB_VERSION: 4.0.28
126-
MONGODB_TOPOLOGY: standalone
127-
MONGODB_STORAGE_ENGINE: mmapv1
128-
NODE_VERSION: 18.1.0
129-
- name: MongoDB 4.0, ReplicaSet, WiredTiger
130-
MONGODB_VERSION: 4.0.28
131-
MONGODB_TOPOLOGY: replicaset
132-
MONGODB_STORAGE_ENGINE: wiredTiger
133-
NODE_VERSION: 18.1.0
134-
- name: MongoDB 4.2, ReplicaSet, WiredTiger
124+
- name: MongoDB 4.2, ReplicaSet
135125
MONGODB_VERSION: 4.2.19
136126
MONGODB_TOPOLOGY: replicaset
137-
MONGODB_STORAGE_ENGINE: wiredTiger
138127
NODE_VERSION: 18.1.0
139-
- name: MongoDB 4.4, ReplicaSet, WiredTiger
128+
- name: MongoDB 4.4, ReplicaSet
140129
MONGODB_VERSION: 4.4.13
141130
MONGODB_TOPOLOGY: replicaset
142-
MONGODB_STORAGE_ENGINE: wiredTiger
143131
NODE_VERSION: 18.1.0
144-
- name: MongoDB 5, ReplicaSet, WiredTiger
132+
- name: MongoDB 5, ReplicaSet
145133
MONGODB_VERSION: 5.3.2
146134
MONGODB_TOPOLOGY: replicaset
147-
MONGODB_STORAGE_ENGINE: wiredTiger
148135
NODE_VERSION: 18.1.0
149-
- name: MongoDB 6, ReplicaSet, WiredTiger
136+
- name: MongoDB 6, ReplicaSet
150137
MONGODB_VERSION: 6.0.2
151138
MONGODB_TOPOLOGY: replicaset
152-
MONGODB_STORAGE_ENGINE: wiredTiger
153139
NODE_VERSION: 18.1.0
154140
- name: Redis Cache
155141
PARSE_SERVER_TEST_CACHE: redis
156142
MONGODB_VERSION: 4.4.13
157143
MONGODB_TOPOLOGY: standalone
158-
MONGODB_STORAGE_ENGINE: wiredTiger
159144
NODE_VERSION: 18.1.0
160145
- name: Node 14
161146
MONGODB_VERSION: 4.4.13
162147
MONGODB_TOPOLOGY: standalone
163-
MONGODB_STORAGE_ENGINE: wiredTiger
164-
NODE_VERSION: 14.21.0
148+
NODE_VERSION: 14.19.1
165149
- name: Node 16
166150
MONGODB_VERSION: 4.4.13
167151
MONGODB_TOPOLOGY: standalone
168-
MONGODB_STORAGE_ENGINE: wiredTiger
169152
NODE_VERSION: 16.14.2
170153
fail-fast: false
171154
name: ${{ matrix.name }}

package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,19 @@
112112
"lint-fix": "eslint --fix --cache ./",
113113
"build": "babel src/ -d lib/ --copy-files",
114114
"watch": "babel --watch src/ -d lib/ --copy-files",
115-
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",
116-
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine",
115+
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start",
116+
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
117117
"test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion",
118-
"test:mongodb:4.0.28": "npm run test:mongodb --dbversion=4.0.28",
119118
"test:mongodb:4.2.19": "npm run test:mongodb --dbversion=4.2.19",
120119
"test:mongodb:4.4.13": "npm run test:mongodb --dbversion=4.4.13",
121120
"test:mongodb:5.3.2": "npm run test:mongodb --dbversion=5.3.2",
122121
"test:mongodb:6.0.2": "npm run test:mongodb --dbversion=6.0.2",
123122
"posttest:mongodb": "mongodb-runner stop",
124-
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",
125-
"testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine",
123+
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start",
124+
"testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
126125
"test": "npm run testonly",
127-
"posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner stop",
128-
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 nyc jasmine",
126+
"posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner stop",
127+
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine",
129128
"start": "node ./bin/parse-server",
130129
"prettier": "prettier --write {src,spec}/{**/*,*}.js",
131130
"prepare": "npm run build",

spec/MongoStorageAdapter.spec.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDataba
66
const request = require('../lib/request');
77
const Config = require('../lib/Config');
88
const TestUtils = require('../lib/TestUtils');
9-
const semver = require('semver');
109

1110
const fakeClient = {
1211
s: { options: { dbName: null } },
@@ -401,11 +400,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
401400
expect(schemaAfterDeletion.fields.test).toBeUndefined();
402401
});
403402

404-
if (
405-
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
406-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
407-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
408-
) {
403+
if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
409404
describe('transactions', () => {
410405
const headers = {
411406
'Content-Type': 'application/json',

spec/ParseServerRESTController.spec.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const ParseServerRESTController = require('../lib/ParseServerRESTController')
22
.ParseServerRESTController;
33
const ParseServer = require('../lib/ParseServer').default;
44
const Parse = require('parse/node').Parse;
5-
const semver = require('semver');
65
const TestUtils = require('../lib/TestUtils');
76

87
let RESTController;
@@ -130,19 +129,13 @@ describe('ParseServerRESTController', () => {
130129
});
131130

132131
if (
133-
(semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
134-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
135-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') ||
132+
process.env.MONGODB_TOPOLOGY === 'replicaset' ||
136133
process.env.PARSE_SERVER_TEST_DB === 'postgres'
137134
) {
138135
describe('transactions', () => {
139136
beforeEach(async () => {
140137
await TestUtils.destroyAllDataPermanently(true);
141-
if (
142-
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
143-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
144-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
145-
) {
138+
if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
146139
await reconfigureServer({
147140
databaseAdapter: undefined,
148141
databaseURI:

spec/batch.spec.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const batch = require('../lib/batch');
22
const request = require('../lib/request');
3-
const semver = require('semver');
43
const TestUtils = require('../lib/TestUtils');
54

65
const originalURL = '/parse/batch';
@@ -206,19 +205,13 @@ describe('batch', () => {
206205
});
207206

208207
if (
209-
(semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
210-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
211-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') ||
208+
process.env.MONGODB_TOPOLOGY === 'replicaset' ||
212209
process.env.PARSE_SERVER_TEST_DB === 'postgres'
213210
) {
214211
describe('transactions', () => {
215212
beforeEach(async () => {
216213
await TestUtils.destroyAllDataPermanently(true);
217-
if (
218-
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
219-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
220-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
221-
) {
214+
if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
222215
await reconfigureServer({
223216
databaseAdapter: undefined,
224217
databaseURI:

0 commit comments

Comments
 (0)