-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParseServer with Aurora Postgres saves 0 and decimals in arrays as string #5239
Comments
Thanks for reporting the issue! The Postgres adapter has a special debugger that traces all the sql commands. You can enable it with setting the environment variable PARSE_SERVER_LOG_LEVEL=debug |
I tried this with Postgres 10 and Aurora PG 10.4 and this works fine for me.
Can you run the following test?
https://github.com/parse-community/parse-server/blob/master/CONTRIBUTING.md |
When I create the object, then retrieve it, and then set array attribute, I got the same issue. But when I set the array on the object without retrieving it, it is fine.
this is the one that doesn't work properly. the final result is [ "0", "1.1", "1", "-2", "3", "4"] |
Issue Description
On Parse using Aurora Postgres:
When saving an array with either a 0 or some decimal value (ex. 1.1) to a field of type Array, those number values are automatically converted to strings somehow. Any other integer is fine. For example, the array becomes ["0", "1.1", 2, 3, 4, 5] when expecting [0, 1.1, 2, 3, 4, 5]. I have tried a lot of weird and random things to try to force the value to an int (like using parseInt(0)), but nothing seems to work. The save is done using .set (for example: record.set('array', [0, 1.1, 2, 3, 4, 5])).
Steps to reproduce
Expected Results
record of Table/Class to have [0, 1.1, 2, 3, 4, 5] set in 'array' field
Actual Outcome
["0", "1.1", 2, 3, 4, 5]
Environment Setup
Server
Database
Logs/Trace
N/A
The text was updated successfully, but these errors were encountered: