Parse-JS-SDK,matchesKeyInQuery不能与objectId一起使用。

时间:2017-10-08 04:52:58

标签: javascript parse-platform parse-server

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

我有三张表,MemberCircleMemberCircle

Circle有一个名为member的指针字段,表示创建circle的人。

MemberCircle有两个指针,membercirclemember表示加入该圈子。

我想查询会员创建和加入的圈子。但matchesKeyInQuery seens不适用于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)

如何编写查询?

1 个答案:

答案 0 :(得分:3)

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.