Skip to content

Difference in Json object returned by Parse Server #803

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

Closed
araaku opened this issue Mar 3, 2016 · 4 comments
Closed

Difference in Json object returned by Parse Server #803

araaku opened this issue Mar 3, 2016 · 4 comments
Assignees
Labels
type:question Support or code-level question

Comments

@araaku
Copy link

araaku commented Mar 3, 2016

I have migrated a Parse app to AWS by following the migration guide. Server is running fine and data is accessible however my application is not able to process the json response returned by server.
Initially, on Parse.com, the json response returned by server starts as the following:

  

 "results": [
      {
         "Parasha": "פרת משפטים",
         "color": "#1b3f94",
         "cover": {
            "__type": "File",
            "name": "0db6899cbbb4-dvar_malchut.jpg",
            "url": "bb4-dvar_malchut.jpg"
         },
         "createdAt": "2016-02-28T20:23:53.449Z",
         "objectId": "FTSc98wrau",
         "updatedAt": "2016-02-28T22:01:32.156Z"
      },

But now, the response received from the migrated Parse server starts as following:

{
   "results": [
      {
         "objectId": "56d5ff8198era17198750fce",
         "results": [
            {
               "Parasha": "פרת משפטים",
               "backCover": {
                  "__type": "File",
                  "name": "tfss-d08252f668-cover-low.jpg",
                  "url": "e-6f608252f668-cover-low.jpg"
               },

_Notice the additional "results": [ and objectIdat the root. _
I could update my app to deal with it but it will be great if this can be fixed from the server end so that I don't need to make changes in my app.
Any help will be appreciated.
Thanks

@flovilmart
Copy link
Contributor

It seems to be a pretty serious issue, Can you post the query you're running?

@araaku
Copy link
Author

araaku commented Mar 4, 2016

Here is the curl request:

curl -X GET -H "X-Parse-Application-Id: " http://52.86.109.86:xxx/parse/classes/TestClass

API key parameter is not included in the curl request as it is optional for the migrated server. This command returns all the objects under TestClass but with an additional root node (as mentioned in the original question above). The same request made to Parse.com returns the JSON data as expected.

Thanks.

@abremner
Copy link

I'm also curious why the query response is different on Parse Server. Previously if I console logged a query response I would get a plain json object. Now if I run the same function the console logs an array of ParseObjectSubclass objects that don't appear to contain anything useful. I can see the correct "results" array in the network response tab, but not sure how to access it?

@araaku
Copy link
Author

araaku commented Mar 17, 2016

I was using the DB Migration tool to transfer records from Parse.com to the new server. Tried again by first taking the back-up of the database in JSON format and then imported it in to the new server. This fixed the issue.
It is hard to believe that it was due to using db migration tool as it is suggested by parse.com and almost everyone is using it to migrate the db. May be it was something else which was specific to my scenario only.
Closing the issue.

@araaku araaku closed this as completed Mar 17, 2016
@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

4 participants