Skip to content

[Feature Request] Deselect Keys #4948

Closed
@dplewis

Description

@dplewis

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I often find myself wanting to select all keys except one or a few. This requires me to specify a lot of keys which is a lot of work.

Describe the solution you'd like
A clear and concise description of what you want to happen.

query.deselect('somefield'); or unselect or exclude or selectAllExcluding()?

If used with select just remove from select
If used without select all keys added excluding

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Aggregate project { key: -1 } will exclude that key. (Only for Mongo 3.4+)

Alternatively you can get the schema and find all the keys from that then remove what you don't need

Additional context
Add any other context or screenshots about the feature request here.

From a quick glance adding this to Mongo should be pretty easy
Postgres uses * or column names. You don’t know the column names if you only uses exclude. So you’ll have to get all fields first then use exclude

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: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