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

Add support for "star" inclusion/exclusion (include all/exclude all) #1008

Merged
merged 10 commits into from
Apr 1, 2024

Conversation

tatu-at-datastax
Copy link
Contributor

@tatu-at-datastax tatu-at-datastax commented Mar 29, 2024

What this PR does:

Adds support for 2 special query projections:

{ "*": 1} // include everything
{"*": 0} // include nothing

as per #1001, as convenience shortcuts that ignore special field (_id, $vector, $vectorize) logic regarding default inclusion/exclusion.

Also prepares for bigger fix, #1005.

Which issue(s) this PR fixes:
Fixes #1001

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this Mar 29, 2024
@tatu-at-datastax tatu-at-datastax changed the title (WIP) Add support for "star" inclusion/exclusion (include all/exclude all) Add support for "star" inclusion/exclusion (include all/exclude all) Mar 29, 2024
@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review March 29, 2024 02:01
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner March 29, 2024 02:01
{
"find": {
"sort" : {"$vector" : [0.15, 0.1, 0.1, 0.35, 0.55]},
"projection" : {"*" : 1},
Copy link
Contributor

@kathirsvn kathirsvn Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test case with non-zero and non-one value as well? (to make sure it behaves as true)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kathirsvn Sounds good, will add in suitable place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added more unit tests to cover non-0/non-1 numbers, booleans.

Copy link
Contributor

@kathirsvn kathirsvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tatu-at-datastax tatu-at-datastax merged commit 30c6934 into main Apr 1, 2024
2 checks passed
@tatu-at-datastax tatu-at-datastax deleted the tatu/1001-add-star-projection branch April 1, 2024 21:49
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support wildcard "include EVERYTHING" and "include NOTHING" for Projection clause
3 participants