Skip to content

Commit e83b39e

Browse files
authored
Merge branch 'alpha' into update-mongo
2 parents a020911 + 3ea1ace commit e83b39e

File tree

5 files changed

+44
-3
lines changed

5 files changed

+44
-3
lines changed

changelogs/CHANGELOG_alpha.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [6.1.0-alpha.18](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.17...6.1.0-alpha.18) (2023-06-08)
2+
3+
4+
### Features
5+
6+
* Add support for `$eq` query constraint in LiveQuery ([#8614](https://github.com/parse-community/parse-server/issues/8614)) ([656d673](https://github.com/parse-community/parse-server/commit/656d673cf5dea354e4f2b3d4dc2b29a41d311b3e))
7+
18
# [6.1.0-alpha.17](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.16...6.1.0-alpha.17) (2023-06-07)
29

310

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": "6.1.0-alpha.17",
3+
"version": "6.1.0-alpha.18",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {

spec/QueryTools.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,35 @@ describe('matchesQuery', function () {
125125
expect(matchesQuery(obj, q)).toBe(false);
126126
});
127127

128+
it('matches queries with eq constraint', function () {
129+
const obj = {
130+
objectId: 'Person2',
131+
score: 12,
132+
name: 'Tom',
133+
};
134+
135+
const q1 = {
136+
objectId: {
137+
$eq: 'Person2',
138+
},
139+
};
140+
141+
const q2 = {
142+
score: {
143+
$eq: 12,
144+
},
145+
};
146+
147+
const q3 = {
148+
name: {
149+
$eq: 'Tom',
150+
},
151+
};
152+
expect(matchesQuery(obj, q1)).toBe(true);
153+
expect(matchesQuery(obj, q2)).toBe(true);
154+
expect(matchesQuery(obj, q3)).toBe(true);
155+
});
156+
128157
it('matches on equality queries', function () {
129158
const day = new Date();
130159
const location = new Parse.GeoPoint({

src/LiveQuery/QueryTools.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ function matchesKeyConstraints(object, key, constraints) {
247247
return false;
248248
}
249249
break;
250+
case '$eq':
251+
if (!equalObjects(object[key], compareTo)) {
252+
return false;
253+
}
254+
break;
250255
case '$ne':
251256
if (equalObjects(object[key], compareTo)) {
252257
return false;

0 commit comments

Comments
 (0)