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 $each modifier of $push update operator #99

Merged
merged 5 commits into from
Feb 13, 2023

Conversation

tatu-at-datastax
Copy link
Contributor

@tatu-at-datastax tatu-at-datastax commented Feb 10, 2023

With #72 basic $push operation was added but it did not support modifiers. The most important one to add (plus one required to support any of the others) is $each; this PR adds support.

@tatu-at-datastax tatu-at-datastax self-assigned this Feb 10, 2023
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 so far, just one test suggestion

UpdateOperator.PUSH.resolveOperation(
objectFromJson(
"""
{ "array" : { "$each" : 365 } }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another good case to test would be using $each to push an array. For example, $push: { $each: [[-80, 25], [-121, 37]] } should push 2 array elements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vkarpov15 Thanks! Yes, good idea, will add.

@tatu-at-datastax tatu-at-datastax changed the title (WIP) Add support for $each modifier of $push update operator Add support for $each modifier of $push update operator Feb 10, 2023
@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review February 10, 2023 22:58
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner February 10, 2023 22:58
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.

Nice, thanks 👍

@tatu-at-datastax tatu-at-datastax merged commit 0bf3d34 into main Feb 13, 2023
@tatu-at-datastax tatu-at-datastax deleted the tatu/80-add-update-oper-push-each branch February 13, 2023 19:56
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.

3 participants