Skip to content

Ability to exclude keys from Query #839

Closed
@RaschidJFR

Description

@RaschidJFR

Is your feature request related to a problem? Please describe.
Parse.Query.selec() lets us minimize the data retrieved by choosing only the keys of interest. But when we need to leave out just a couple of keys from a large property list -for example, when removing sensitive data fields from unlogged users- we need to input a very long array of keys in the select() method.

The issue scales when you're still developing the class models and later on you add more properties to registered classes, so you could easily skip to add the new properties to the select() method or you could misspell any of them as the list is still growing.

Describe the solution you'd like
A method that instead of "whitlisting" the properties to retrieve, it "blacklists" the properties not to. It could be called something like Parse.Query.exclude() or Parse.Query.unselect().

Describe alternatives you've considered
As I said, the current alternative is to type in all the properties but one, being susceptible to errors.

Additional context
I'm having this problem currently when trying to filter data inside the beforeFind hook on cloud code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions