Skip to content

Commit c40fb8a

Browse files
authored
Merge branch 'parse-community:master' into pr_prettierQuotes
2 parents e2abccd + 8fddac3 commit c40fb8a

File tree

7 files changed

+140
-54
lines changed

7 files changed

+140
-54
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- '**'
99
env:
10-
NODE_VERSION: 14.17.4
10+
NODE_VERSION: 14.17.5
1111
PARSE_SERVER_TEST_TIMEOUT: 20000
1212
jobs:
1313
check-ci:
@@ -97,38 +97,38 @@ jobs:
9797
MONGODB_VERSION: 5.0.2
9898
MONGODB_TOPOLOGY: replicaset
9999
MONGODB_STORAGE_ENGINE: wiredTiger
100-
NODE_VERSION: 14.17.4
100+
NODE_VERSION: 14.17.5
101101
- name: MongoDB 4.4, ReplicaSet, WiredTiger
102102
MONGODB_VERSION: 4.4.8
103103
MONGODB_TOPOLOGY: replicaset
104104
MONGODB_STORAGE_ENGINE: wiredTiger
105-
NODE_VERSION: 14.17.4
105+
NODE_VERSION: 14.17.5
106106
- name: MongoDB 4.2, ReplicaSet, WiredTiger
107107
MONGODB_VERSION: 4.2.15
108108
MONGODB_TOPOLOGY: replicaset
109109
MONGODB_STORAGE_ENGINE: wiredTiger
110-
NODE_VERSION: 14.17.4
110+
NODE_VERSION: 14.17.5
111111
- name: MongoDB 4.0, ReplicaSet, WiredTiger
112112
MONGODB_VERSION: 4.0.25
113113
MONGODB_TOPOLOGY: replicaset
114114
MONGODB_STORAGE_ENGINE: wiredTiger
115-
NODE_VERSION: 14.17.4
115+
NODE_VERSION: 14.17.5
116116
- name: MongoDB 4.0, Standalone, MMAPv1
117117
MONGODB_VERSION: 4.0.25
118118
MONGODB_TOPOLOGY: standalone
119119
MONGODB_STORAGE_ENGINE: mmapv1
120-
NODE_VERSION: 14.17.4
120+
NODE_VERSION: 14.17.5
121121
- name: Redis Cache
122122
PARSE_SERVER_TEST_CACHE: redis
123123
MONGODB_VERSION: 4.4.8
124124
MONGODB_TOPOLOGY: standalone
125125
MONGODB_STORAGE_ENGINE: wiredTiger
126-
NODE_VERSION: 14.17.4
126+
NODE_VERSION: 14.17.5
127127
- name: Node 12
128128
MONGODB_VERSION: 4.4.8
129129
MONGODB_TOPOLOGY: standalone
130130
MONGODB_STORAGE_ENGINE: wiredTiger
131-
NODE_VERSION: 12.22.4
131+
NODE_VERSION: 12.22.5
132132
- name: Node 15
133133
MONGODB_VERSION: 4.4.8
134134
MONGODB_TOPOLOGY: standalone
@@ -175,16 +175,16 @@ jobs:
175175
include:
176176
- name: PostgreSQL 11, PostGIS 3.0
177177
POSTGRES_IMAGE: postgis/postgis:11-3.0
178-
NODE_VERSION: 14.17.4
178+
NODE_VERSION: 14.17.5
179179
- name: PostgreSQL 11, PostGIS 3.1
180180
POSTGRES_IMAGE: postgis/postgis:11-3.1
181-
NODE_VERSION: 14.17.4
181+
NODE_VERSION: 14.17.5
182182
- name: PostgreSQL 12, PostGIS 3.1
183183
POSTGRES_IMAGE: postgis/postgis:12-3.1
184-
NODE_VERSION: 14.17.4
184+
NODE_VERSION: 14.17.5
185185
- name: PostgreSQL 13, PostGIS 3.1
186186
POSTGRES_IMAGE: postgis/postgis:13-3.1
187-
NODE_VERSION: 14.17.4
187+
NODE_VERSION: 14.17.5
188188
fail-fast: false
189189
name: ${{ matrix.name }}
190190
timeout-minutes: 15

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ ___
105105
- Add official support for MongoDB 5.0 (Manuel Trezza) [#7469](https://github.com/parse-community/parse-server/pull/7469)
106106

107107
### Other Changes
108+
- Support native mongodb syntax in aggregation pipelines (Raschid JF Rafeally) [#7339](https://github.com/parse-community/parse-server/pull/7339)
108109
- Fix error when a not yet inserted job is updated (Antonio Davi Macedo Coelho de Castro) [#7196](https://github.com/parse-community/parse-server/pull/7196)
109110
- request.context for afterFind triggers (dblythy) [#7078](https://github.com/parse-community/parse-server/pull/7078)
110111
- Winston Logger interpolating stdout to console (dplewis) [#7114](https://github.com/parse-community/parse-server/pull/7114)

DEPRECATIONS.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
The following is a list of deprecations, according to the [Deprecation Policy](https://github.com/parse-community/parse-server/blob/master/CONTRIBUTING.md#deprecation-policy). After a feature becomes deprecated, and giving developers time to adapt to the change, the deprecated feature will eventually be removed, leading to a breaking change. Developer feedback during the deprecation period may postpone the introduction of the breaking change.
44

5-
| Feature | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
6-
|---------|----|------------------|----------------------|----------|-------|
7-
(none)
8-
5+
| Feature | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
6+
|-----------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
7+
| Native MongoDB syntax in aggregation pipeline | [#7338](https://github.com/parse-community/parse-server/issues/7338) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
98

109
[i_deprecation]: ## "The version and date of the deprecation."
1110
[i_removal]: ## "The version and date of the planned removal."
12-
[i_status]: ## "The current status of the deprecation: deprecated (the feature is deprecated and still available), removed (the deprecated feature has been removed and is unavailable), retracted (the deprecation has been retracted and the feature will not be removed."
11+
[i_status]: ## "The current status of the deprecation: deprecated (the feature is deprecated and still available), removed (the deprecated feature has been removed and is unavailable), retracted (the deprecation has been retracted and the feature will not be removed."

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ Parse Server is continuously tested with the most recent releases of Node.js to
114114

115115
| Version | Latest Version | End-of-Life Date | Compatibility |
116116
|------------|----------------|------------------|--------------------|
117-
| Node.js 12 | 12.22.4 | April 2022 | ✅ Fully compatible |
118-
| Node.js 14 | 14.17.4 | April 2023 | ✅ Fully compatible |
117+
| Node.js 12 | 12.22.5 | April 2022 | ✅ Fully compatible |
118+
| Node.js 14 | 14.17.5 | April 2023 | ✅ Fully compatible |
119119
| Node.js 15 | 15.14.0 | June 2021 | ✅ Fully compatible |
120120

121121
#### MongoDB

spec/AggregateRouter.spec.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const AggregateRouter = require('../lib/Routers/AggregateRouter').AggregateRouter;
22

33
describe('AggregateRouter', () => {
4+
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
45
it('get pipeline from Array', () => {
56
const body = [
67
{
@@ -12,6 +13,7 @@ describe('AggregateRouter', () => {
1213
expect(result).toEqual(expected);
1314
});
1415

16+
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
1517
it('get pipeline from Object', () => {
1618
const body = {
1719
group: { objectId: {} },
@@ -21,6 +23,7 @@ describe('AggregateRouter', () => {
2123
expect(result).toEqual(expected);
2224
});
2325

26+
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
2427
it('get pipeline from Pipeline Operator (Array)', () => {
2528
const body = {
2629
pipeline: [
@@ -34,6 +37,7 @@ describe('AggregateRouter', () => {
3437
expect(result).toEqual(expected);
3538
});
3639

40+
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
3741
it('get pipeline from Pipeline Operator (Object)', () => {
3842
const body = {
3943
pipeline: {
@@ -45,6 +49,7 @@ describe('AggregateRouter', () => {
4549
expect(result).toEqual(expected);
4650
});
4751

52+
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
4853
it('get pipeline fails multiple keys in Array stage ', () => {
4954
const body = [
5055
{
@@ -59,6 +64,7 @@ describe('AggregateRouter', () => {
5964
}
6065
});
6166

67+
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
6268
it('get pipeline fails multiple keys in Pipeline Operator Array stage ', () => {
6369
const body = {
6470
pipeline: [
@@ -75,6 +81,7 @@ describe('AggregateRouter', () => {
7581
}
7682
});
7783

84+
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
7885
it('get search pipeline from Pipeline Operator (Array)', () => {
7986
const body = {
8087
pipeline: {
@@ -85,4 +92,73 @@ describe('AggregateRouter', () => {
8592
const result = AggregateRouter.getPipeline(body);
8693
expect(result).toEqual(expected);
8794
});
95+
96+
it('support stage name starting with `$`', () => {
97+
const body = {
98+
$match: { someKey: 'whatever' },
99+
};
100+
const expected = [{ $match: { someKey: 'whatever' } }];
101+
const result = AggregateRouter.getPipeline(body);
102+
expect(result).toEqual(expected);
103+
});
104+
105+
it('support nested stage names starting with `$`', () => {
106+
const body = [
107+
{
108+
lookup: {
109+
from: 'ACollection',
110+
let: { id: '_id' },
111+
as: 'results',
112+
pipeline: [
113+
{
114+
$match: {
115+
$expr: {
116+
$eq: ['$_id', '$$id'],
117+
},
118+
},
119+
},
120+
],
121+
},
122+
},
123+
];
124+
const expected = [
125+
{
126+
$lookup: {
127+
from: 'ACollection',
128+
let: { id: '_id' },
129+
as: 'results',
130+
pipeline: [
131+
{
132+
$match: {
133+
$expr: {
134+
$eq: ['$_id', '$$id'],
135+
},
136+
},
137+
},
138+
],
139+
},
140+
},
141+
];
142+
const result = AggregateRouter.getPipeline(body);
143+
expect(result).toEqual(expected);
144+
});
145+
146+
it('support the use of `_id` in stages', () => {
147+
const body = [
148+
{ match: { _id: 'randomId' } },
149+
{ sort: { _id: -1 } },
150+
{ addFields: { _id: 1 } },
151+
{ group: { _id: {} } },
152+
{ project: { _id: 0 } },
153+
];
154+
const expected = [
155+
{ $match: { _id: 'randomId' } },
156+
{ $sort: { _id: -1 } },
157+
{ $addFields: { _id: 1 } },
158+
{ $group: { _id: {} } },
159+
{ $project: { _id: 0 } },
160+
];
161+
const result = AggregateRouter.getPipeline(body);
162+
expect(result).toEqual(expected);
163+
});
88164
});

0 commit comments

Comments
 (0)