Skip to content

Commit c24a01c

Browse files
Merge pull request #1 from RahulLanjewar93/release-7.x.x
2 parents 90bb0db + 07f72ff commit c24a01c

File tree

4 files changed

+135
-60
lines changed

4 files changed

+135
-60
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"license": "Apache-2.0",
2121
"dependencies": {
2222
"@apollo/server": "4.11.2",
23-
"@babel/eslint-parser": "7.26.5",
23+
"@babel/eslint-parser": "7.27.0",
2424
"@graphql-tools/merge": "9.0.17",
2525
"@graphql-tools/schema": "10.0.18",
2626
"@graphql-tools/utils": "10.6.3",
@@ -63,7 +63,7 @@
6363
"uuid": "11.0.3",
6464
"winston": "3.17.0",
6565
"winston-daily-rotate-file": "5.0.0",
66-
"ws": "8.18.0"
66+
"ws": "8.18.1"
6767
},
6868
"devDependencies": {
6969
"@actions/core": "1.11.1",

spec/MongoStorageAdapter.spec.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,77 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
390390
await expectAsync(adapter.getClass('UnknownClass')).toBeRejectedWith(undefined);
391391
});
392392

393+
394+
/**
395+
* If we use equalTo to comparse the nested pointer it works
396+
* But it does not work with contained in or matchesQuery
397+
*/
398+
it('Parse query works with nested objects if equal to is used', async () => {
399+
const child = new Parse.Object('Child')
400+
child.set('key','value')
401+
await child.save();
402+
403+
const parent = new Parse.Object('Parent');
404+
parent.set('some' ,{
405+
nested : {
406+
key : {
407+
child
408+
}
409+
}
410+
})
411+
await parent.save();
412+
413+
const query1 = await new Parse.Query('Parent')
414+
.equalTo('some.nested.key.child', child)
415+
.find();
416+
417+
expect(query1.length).toEqual(1);
418+
})
419+
420+
it('Parse query works when containedIn is used', async () => {
421+
const child = new Parse.Object('Child')
422+
child.set('key','value')
423+
await child.save();
424+
425+
const parent = new Parse.Object('Parent');
426+
parent.set('some' ,{
427+
nested : {
428+
key : {
429+
child
430+
}
431+
}
432+
})
433+
await parent.save();
434+
435+
const query1 = await new Parse.Query('Parent')
436+
.containedIn('some.nested.key.child', [child])
437+
.find();
438+
439+
expect(query1.length).toEqual(1);
440+
})
441+
442+
it('Parse query works when matchesQuery is used which in turn uses contained in', async () => {
443+
const child = new Parse.Object('Child')
444+
child.set('key','value')
445+
await child.save();
446+
447+
const parent = new Parse.Object('Parent');
448+
parent.set('some' ,{
449+
nested : {
450+
key : {
451+
child
452+
}
453+
}
454+
})
455+
await parent.save();
456+
457+
const query1 = await new Parse.Query('Parent')
458+
.matchesQuery('some.nested.key.child', new Parse.Query('Child').equalTo('key','value'))
459+
.find();
460+
461+
expect(query1.length).toEqual(1);
462+
})
463+
393464
it_only_mongodb_version('<5.1 || >=6')('should use index for caseInsensitive query', async () => {
394465
const user = new Parse.User();
395466
user.set('username', 'Bugs');

0 commit comments

Comments
 (0)