-
Notifications
You must be signed in to change notification settings - Fork 409
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
Support $rename
field update operator
#670
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #670 +/- ##
==========================================
+ Coverage 62.91% 63.03% +0.12%
==========================================
Files 191 191
Lines 7563 7597 +34
==========================================
+ Hits 4758 4789 +31
- Misses 2245 2247 +2
- Partials 560 561 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
ctx, collection := setup(t) | ||
|
||
_, err := collection.InsertMany(ctx, []any{ | ||
bson.D{{"_id", "1"}, {"name", "alex"}, {"phone", "9012345678"}}, | ||
bson.D{{"_id", "2"}, {"name", "bob"}}, | ||
}) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it becomes a problem that, unlike find
tests, each update
test uses its own data set. Let's put that PR on pause until we decide if we want to do something about that. Created #674 for tracking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's hook into update_field_compat_test.go instead of using test-specific data set
$rename
field update operator
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also resolve merge conflicts
ctx, collection := setup(t) | ||
|
||
_, err := collection.InsertMany(ctx, []any{ | ||
bson.D{{"_id", "1"}, {"name", "alex"}, {"phone", "9012345678"}}, | ||
bson.D{{"_id", "2"}, {"name", "bob"}}, | ||
}) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's hook into update_field_compat_test.go instead of using test-specific data set
@@ -113,6 +113,46 @@ func UpdateDocument(doc, update *types.Document) (bool, error) { | |||
} | |||
} | |||
|
|||
case "$rename": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move that code to the new function processRenameFieldExpression
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make the necessary changes.
Supported in #1753. |
Closes #626.