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

query.select() should overwrite previous selection #14180

Closed
2 tasks done
caub opened this issue Dec 15, 2023 · 1 comment
Closed
2 tasks done

query.select() should overwrite previous selection #14180

caub opened this issue Dec 15, 2023 · 1 comment
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class

Comments

@caub
Copy link
Contributor

caub commented Dec 15, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Calling .select(fields) should set the query selection to fields

Currently there's no way to reset a previous one, example

query.select({ a: 0 });
query.select({ b: 1, c: 1});

then current select is a merge of the 2 (but that'll cause issues of mixed types (0/1))

Motivation

If a .select() is done from a low-level method, as a default selection, we should be able to overwrite it from elsewhere is in codebase

Example

No response

@caub caub added enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class labels Dec 15, 2023
@vkarpov15
Copy link
Collaborator

Use query.projection() instead, query.projection() overwrites the existing projection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class
Projects
None yet
Development

No branches or pull requests

2 participants