Parse-JS-SDK, the matchesKeyInQuery not work with objectId。

Viewed 732

javascript "parse-server": "^2.6.3", "parse": "^1.10.0",

I have three Table, Member 、 Circle and MemberCircle 。

Circle has a pointer field named member,it means who create the circle 。

And MemberCircle has two pointer filed, member and circle。 the member means who join the circle。

I want to query the circles which the member create and join。but the matchesKeyInQuery seens not work with the objectId。

const member = new Parse.Object('Member')
member.id = 'memberid'
const queryPage = new Parse.Query('Circle')
const queryOwn = queryPage.equalTo('member', member).equalTo('status', 1)
const queryJoin = new Parse.Query('Circle').matchesKeyInQuery('objectId', 'circle', new Parse.Query('MemberCircle').equalTo('member', member))

Parse.Query.or(queryOwn, queryJoin).limit(15).skip(prePage * pageSize)

How to write the query?

1 Answers

Using matchesKeyInQuery with objectId is now possible using dot notation in the latest release of parse-server 2.7.2.

Replace the query-key 'circle' with 'circle.objectId'

Here is this pull request to parse-server that addressed this.

Related