Skip to content

Exclude child elements in query results #7030

Closed
@uzaysan

Description

@uzaysan

Is your feature request related to a problem? Please describe.
In parse server we can put parse objects to another parse object. And we can get them with include method.
We also select specific fields from child objects with select method.
But we cannot exclude fields from child object. Lets assume we have Book object. And author field is a pointer to a user. If I want to get author alongside with book object, user object is fully fetched. But If I want to exclude some sensitive fields such as email field, I can't do that. Exclude method only works for Book object. But User objects is ignored.

Describe the solution you'd like
We should be able to exclude unwanted fields from child objects. Here is an example code:

var query = New Parse.Query("Book");
query.include("author");
query.exclude("someBookField","author.email");
...
const results = await.query.find();
//There is no email field in results.

Describe alternatives you've considered
We can convert parse objects to JSON and we can delete the unwanted fields by manually. But this is useless if our main porpouse is save bandwidth costs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-betaReleased as beta versiontype:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions