parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Include={field.2ndLevel} of array of pointers which point to not existing objects returns error.

Open dtsymbal opened this issue 10 years ago • 1 comments

Check out this issue for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

Parse-server running locally: v.2.2.4

Steps to reproduce

  • create class Color

curl -X POST "$apiUrl/schemas/Color" -H "X-Parse-Application-Id: $applicationId" -H "X-Parse-Master-Key: $masterKey" -H "Content-Type: application/json" -d '{"className": "Color", "fields": {"hex": {"type": "String"}}}'

  • create class Circle

curl -X POST "$apiUrl/schemas/Circle" -H "X-Parse-Application-Id: $applicationId" -H "X-Parse-Master-Key: $masterKey" -H "Content-Type: application/json" -d '{"className": "Circle", "fields": {"radius": {"type": "Number"}, "color": {"type": "Pointer", "targetClass": "Color"}}}'

  • create class ComplexFigure and object with invalid pointer

curl -X POST "$apiUrl/schemas/ComplexFigure" -H "X-Parse-Application-Id: $applicationId" -H "X-Parse-Master-Key: $masterKey" -H "Content-Type: application/json" -d '{"className": "ComplexFigure", "fields": {"consistsOf": {"type": "Array"}}}' curl -X POST "$apiUrl/classes/ComplexFigure" -H "X-Parse-Application-Id: $applicationId" -H "Content-Type: application/json" -d '{"consistsOf": [{"__type": "Pointer", "className": "Circle", "objectId": "notExistingId"}]}'

  • query

curl -X GET "$apiUrl/classes/ComplexFigure" -H "X-Parse-Application-Id: $applicationId" -H "Content-Type: application/json" -G --data-urlencode "include=consistsOf.color"

{"code":102,"error":"can only include pointer fields"}

Logs/Trace

{"code":102,"error":"can only include pointer fields"}

dtsymbal avatar Mar 31 '16 11:03 dtsymbal

maybe it somehow connected with https://github.com/ParsePlatform/parse-server/issues/1293

dtsymbal avatar Mar 31 '16 12:03 dtsymbal