Start a new topic
Answered

Editing JSON in the console

is there a way to edit data on the console so that it preserves it as JSON?

If I enter: {foo: "bar"} on the console, it gets saved as:  "{foo: "bar"} and then gets interpreted as a string when I fetch it.

(Similar if I try to enter an array with [])

Is there a way to get the console to respect more than basic data types?


Best Answer

Hello Joel,


Thank you for posting your question to the Kinvey Support Forum.


The problem that you are encountering is that the following code...


{foo: "bar"} 


...is not actually valid JSON. 


{"foo": "bar"} is the correct syntax to use. If you enter that on the console, it gets saved correctly as JSON.


We hope this helps. Please let us know if you have any questions.


Regards,


Billy Gee




Answer

Hello Joel,


Thank you for posting your question to the Kinvey Support Forum.


The problem that you are encountering is that the following code...


{foo: "bar"} 


...is not actually valid JSON. 


{"foo": "bar"} is the correct syntax to use. If you enter that on the console, it gets saved correctly as JSON.


We hope this helps. Please let us know if you have any questions.


Regards,


Billy Gee



aha, thank you.

Hello Joel,


You're welcome.


Regards,


Billy Gee

Login or Signup to post a comment