parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.7k stars 4.76k forks source link

feat: Support dot notation on array fields #9115

Open dplewis opened 2 months ago

dplewis commented 2 months ago

Pull Request

Issue

Currently all dot notations are treated as operations on Object type field. This results in a error: Cannot read property '0' of undefined when used on Array type fields.

Closes: https://github.com/parse-community/parse-server/issues/6687

Approach

Check types for Array vs Fields based on dot notation format.

https://www.mongodb.com/docs/manual/core/document/#dot-notation

Tasks

parse-github-assistant[bot] commented 2 months ago

Thanks for opening this pull request!

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.14%. Comparing base (f1469c6) to head (201993f). Report is 13 commits behind head on alpha.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## alpha #9115 +/- ## ======================================= Coverage 94.13% 94.14% ======================================= Files 186 186 Lines 14687 14727 +40 ======================================= + Hits 13826 13864 +38 - Misses 861 863 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dplewis commented 2 months ago

@mtrezza This is an extremely complicated feature. I tried running this with the SDK internal fix against the server test suite and got Array dot notation working but it somehow broke the server. I’ll let you know when this is ready for review.