parse-server: Because relationship columns do not accept keysToReturn or excludeKeys

New Issue Checklist

Issue Description

See that even specifying only query.keysToReturn([‘name’]); query.excludeKeys([‘expertises’]); the response returns me the expertises column which is relational.

Steps to reproduce

any query

Actual Outcome

with expertises

Expected Outcome

without expertises

Environment

Parse Flutter SDK

  • SDK version: parse_server_sdk_flutter: ^4.0.0
  • Flutter version: 3.7.7
  • Dart version: 2.19.4
  • Operating system version: PopOS

Server

  • Parse Server version: 5.2.3

Logs

I/flutter ( 5351): ╭-- Parse Request
I/flutter ( 5351): curl -X GET -H 'user-agent: Flutter Parse SDK 4.0.2' -H 'X-Parse-Application-Id: ' -H 'X-Parse-Session-Token: r:' -H 'X-Parse-Client-Key: ' https://parseapi.back4app.com/classes/Medical?where=%7B%22seller%22:%20%7B%22__type%22:%22Pointer%22,%22className%22:%22UserProfile%22,%22objectId%22:%22mwHolsSQ5U%22%7D,%22isDeleted%22:%20false%7D&keys=name&excludeKeys=expertises&order=-updatedAt&skip=0&limit=2&include=seller
I/flutter ( 5351):
I/flutter ( 5351):  https://parseapi.back4app.com/classes/Medical?where={"seller": {"__type":"Pointer","className":"UserProfile","objectId":"mwHolsSQ5U"},"isDeleted": false}&keys=name&excludeKeys=expertises&order=-updatedAt&skip=0&limit=2&include=seller
I/flutter ( 5351): ╰--
I/flutter ( 5351): ╭-- Parse Response
I/flutter ( 5351): Class: Medical
I/flutter ( 5351): Function: ParseApiRQ.query
I/flutter ( 5351): Status Code: 200
I/flutter ( 5351): Payload: [{"className":"Medical","objectId":"rOs5XoBa3o","createdAt":"2023-04-07T18:41:39.636Z","updatedAt":"2023-04-08T09:17:59.390Z","name":"def","expertises":{"__type":"Relation","className":"Expertise","objects":null}}, {"className":"Medical","objectId":"p5qwOVx2Ue","createdAt":"2023-04-06T09:16:06.559Z","updatedAt":"2023-04-08T09:17:48.076Z","name":"abc","expertises":{"__type":"Relation","className":"Expertise","objects":null}}]
I/flutter ( 5351): ╰--
I/flutter ( 5351): name: true
I/flutter ( 5351): crm: false
I/flutter ( 5351): expertises: true

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Could someone open a PR with a failing test? You could just duplicate and modify an existing test, but add a pointer as the excluded field, see

https://github.com/parse-community/parse-server/blob/65e5879e42cefb4b462c9383af3705d027131242/spec/ParseQuery.spec.js#L3538

Yes. See an example Table with: name (String), age (Number), expertises (relational with Expertise). If I do Query.keysToReturn([‘name’]); The answer is name | expertise And their respective data. The test: parseObject.containsKey(‘name’); // true parseObject.containsKey(‘age’); //false parseObject.containsKey(‘expertises’) // true But I didn’t ask for expertise.