Skip to content

Commit 4735b71

Browse files
authored
Merge branch 'alpha' into dependabot/npm_and_yarn/follow-redirects-1.15.9
2 parents 405853a + 15bb17d commit 4735b71

File tree

6 files changed

+60
-13
lines changed

6 files changed

+60
-13
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
############################################################
22
# Build stage
33
############################################################
4-
FROM node:20.14.0-alpine3.20 AS build
4+
FROM node:20.17.0-alpine3.20 AS build
55

66
RUN apk --no-cache add \
77
build-base \
@@ -28,7 +28,7 @@ RUN npm ci --omit=dev --ignore-scripts \
2828
############################################################
2929
# Release stage
3030
############################################################
31-
FROM node:20.14.0-alpine3.20 AS release
31+
FROM node:20.17.0-alpine3.20 AS release
3232

3333
VOLUME /parse-server/cloud /parse-server/config
3434

changelogs/CHANGELOG_alpha.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [7.4.0-alpha.4](https://github.com/parse-community/parse-server/compare/7.4.0-alpha.3...7.4.0-alpha.4) (2024-10-22)
2+
3+
4+
### Bug Fixes
5+
6+
* `Parse.Query.distinct` fails due to invalid aggregate stage 'hint' ([#9295](https://github.com/parse-community/parse-server/issues/9295)) ([5f66c6a](https://github.com/parse-community/parse-server/commit/5f66c6a075cbe1cdaf9d1b108ee65af8ae596b89))
7+
8+
# [7.4.0-alpha.3](https://github.com/parse-community/parse-server/compare/7.4.0-alpha.2...7.4.0-alpha.3) (2024-10-22)
9+
10+
11+
### Features
12+
13+
* Add support for PostGIS 3.5 ([#9354](https://github.com/parse-community/parse-server/issues/9354)) ([8ea3538](https://github.com/parse-community/parse-server/commit/8ea35382db3436d54ab59bd30706705564b0985c))
14+
115
# [7.4.0-alpha.2](https://github.com/parse-community/parse-server/compare/7.4.0-alpha.1...7.4.0-alpha.2) (2024-10-07)
216

317

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "7.4.0-alpha.2",
3+
"version": "7.4.0-alpha.4",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {

spec/ParseQuery.spec.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
const Parse = require('parse/node');
88
const request = require('../lib/request');
9+
const ParseServerRESTController = require('../lib/ParseServerRESTController').ParseServerRESTController;
10+
const ParseServer = require('../lib/ParseServer').default;
911

1012
const masterKeyHeaders = {
1113
'X-Parse-Application-Id': 'test',
@@ -5275,4 +5277,33 @@ describe('Parse.Query testing', () => {
52755277
// Validate
52765278
expect(result.executionStats).not.toBeUndefined();
52775279
});
5280+
5281+
it('should query with distinct within eachBatch and direct access enabled', async () => {
5282+
await reconfigureServer({
5283+
directAccess: true,
5284+
});
5285+
5286+
Parse.CoreManager.setRESTController(
5287+
ParseServerRESTController(Parse.applicationId, ParseServer.promiseRouter({ appId: Parse.applicationId }))
5288+
);
5289+
5290+
const user = new Parse.User();
5291+
user.set('username', 'foo');
5292+
user.set('password', 'bar');
5293+
await user.save();
5294+
5295+
const score = new Parse.Object('Score');
5296+
score.set('player', user);
5297+
score.set('score', 1);
5298+
await score.save();
5299+
5300+
await new Parse.Query('_User')
5301+
.equalTo('objectId', user.id)
5302+
.eachBatch(async ([user]) => {
5303+
const score = await new Parse.Query('Score')
5304+
.equalTo('player', user)
5305+
.distinct('score', { useMasterKey: true });
5306+
expect(score).toEqual([1]);
5307+
}, { useMasterKey: true });
5308+
});
52785309
});

src/Routers/AggregateRouter.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import ClassesRouter from './ClassesRouter';
2-
import rest from '../rest';
3-
import * as middleware from '../middlewares';
41
import Parse from 'parse/node';
2+
import * as middleware from '../middlewares';
3+
import rest from '../rest';
4+
import ClassesRouter from './ClassesRouter';
55
import UsersRouter from './UsersRouter';
66

77
export class AggregateRouter extends ClassesRouter {
@@ -52,7 +52,7 @@ export class AggregateRouter extends ClassesRouter {
5252
}
5353

5454
/* Builds a pipeline from the body. Originally the body could be passed as a single object,
55-
* and now we support many options
55+
* and now we support many options.
5656
*
5757
* Array
5858
*
@@ -71,17 +71,19 @@ export class AggregateRouter extends ClassesRouter {
7171
*
7272
* body: {
7373
* pipeline: {
74-
* group: { objectId: '$name' },
74+
* $group: { objectId: '$name' },
7575
* }
7676
* }
7777
*
7878
*/
7979
static getPipeline(body) {
8080
let pipeline = body.pipeline || body;
8181
if (!Array.isArray(pipeline)) {
82-
pipeline = Object.keys(pipeline).map(key => {
83-
return { [key]: pipeline[key] };
84-
});
82+
pipeline = Object.keys(pipeline)
83+
.filter(key => pipeline[key] !== undefined)
84+
.map(key => {
85+
return { [key]: pipeline[key] };
86+
});
8587
}
8688

8789
return pipeline.map(stage => {

0 commit comments

Comments
 (0)