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

[Feature Request] Deselect Keys #4948

Closed
dplewis opened this issue Aug 10, 2018 · 12 comments · Fixed by #5737
Closed

[Feature Request] Deselect Keys #4948

dplewis opened this issue Aug 10, 2018 · 12 comments · Fixed by #5737
Labels
type:feature New feature or improvement of existing feature

Comments

@dplewis
Copy link
Member

dplewis commented Aug 10, 2018

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

@ozeas
Copy link

ozeas commented Oct 4, 2018

Hello, I would like to help with this, can I?

@dplewis
Copy link
Member Author

dplewis commented Oct 4, 2018

@ozeas Its all yours feel free to open a PR and let us know if you need direction

@srameshr
Copy link
Contributor

srameshr commented Dec 4, 2018

@dplewis @ozeas You guys working on this?

@dplewis
Copy link
Member Author

dplewis commented Dec 4, 2018

It’s up for grabs. Feel free to do a PR.

@ozeas
Copy link

ozeas commented Jan 21, 2019

Hi everyone, I had some personal problems, I could not continue. Sorry about that.

@flovilmart
Copy link
Contributor

Take care @ozeas

@RaschidJFR
Copy link
Contributor

🙋‍♂️ I want in!
So I just start working on this, right? I guess there's no specific deadline, but anyway I'll try not to delay it that much while getting familiar with the repo.

Just point me in the right direction: It seems to me this is to be done in the JS-SDK, not on the server... or why is this posted in the server repo? I'm I supposing wrong?

@dplewis
Copy link
Member Author

dplewis commented Jun 15, 2019

You have to add it to the server first. Here is a sample PR. #4195 and there are a lot of other examples from previous Pull Requests.

The SDK sends the request to the server. You can use the Rest API to send the requests.

@RaschidJFR
Copy link
Contributor

So how do you think guys this restOption should be called? Currently the selecting option is keys, so let's call this new option excludeKeys, ok?

@dplewis
Copy link
Member Author

dplewis commented Jun 19, 2019

excludeKeys or exclude whichever one you want

@srameshr
Copy link
Contributor

exclude

@RaschidJFR
Copy link
Contributor

I have added and tested a new restOption as excludeKeys. Can you have a look @dplewis ? If that's ok then all proceed to update the docs and add the function to the SDK repo i guess.

@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants