Skip to content
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

"_id" in Object fields is being renamed to "objectId" #1417

Closed
3 tasks done
blacha opened this issue Apr 7, 2016 · 3 comments
Closed
3 tasks done

"_id" in Object fields is being renamed to "objectId" #1417

blacha opened this issue Apr 7, 2016 · 3 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@blacha
Copy link
Contributor

blacha commented Apr 7, 2016

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

Test Schema

{
    "_id" : "Test",
    "objectId" : "string",
    "updatedAt" : "string",
    "createdAt" : "string",
    "data" : "object"
}

Test Data

{
    "_id" : "tqwysmYbjP",
    "data" : {
        "_id": "testObjectKey",
        "arr" : [ {
                "_id" : "testArrayKey",
                "_testKey" : "otherKey"
            }],
        "obj": {
            "_id": "testNestedObjectKey"
        }
    },
    "_updated_at" : ISODate("2016-04-07T04:22:47.653Z"),
    "_created_at" : ISODate("2016-04-07T04:22:47.653Z")
}

When querying this Class the output I receive is:

{
    "results": [{
        "objectId": "tqwysmYbjP",
        "data": {
            "objectId": "testObjectKey",
            "arr": [{
                "objectId": "testArrayKey",
                "_testKey": "otherKey"
            }],
            "obj": {
                "objectId": "testNestedObjectKey"
            }
        },
        "updatedAt": "2016-04-07T04:22:47.653Z",
        "createdAt": "2016-04-07T04:22:47.653Z"
    }]
}

Steps to reproduce

Fetch the Test Class in parse dashboard/curl and look at the results.

Logs/Trace

N/A

@blacha
Copy link
Contributor Author

blacha commented Apr 7, 2016

With the same data on parse.com this is the output for the same query.

{
    "results": [
        {
            "createdAt": "2016-04-07T21:30:07.528Z",
            "data": {
                "_id": "testObjectKey",
                "arr": [
                    {
                        "_id": "testArrayKey",
                        "_testKey": "otherKey"
                    }
                ],
                "obj": {
                    "_id": "testNestedObjectKey"
                }
            },
            "objectId": "VvFMrOwBhF",
            "updatedAt": "2016-04-07T21:30:11.447Z"
        }
    ]
}

@drew-gross drew-gross added the type:bug Impaired feature or lacking behavior that is likely assumed label Apr 7, 2016
@blacha
Copy link
Contributor Author

blacha commented Apr 7, 2016

in transform.js keys are being renamed even when they are inside fields of type Object and Array.

What would happen if you stopped traversing these fields?

@drew-gross
Copy link
Contributor

Verified. Working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants