-
Notifications
You must be signed in to change notification settings - Fork 16
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 dot-notation with $inc update operator #196
Conversation
@@ -23,7 +23,8 @@ public static PopOperation construct(ObjectNode args) { | |||
List<PopAction> actions = new ArrayList<>(); | |||
while (fieldIter.hasNext()) { | |||
Map.Entry<String, JsonNode> entry = fieldIter.next(); | |||
final String name = entry.getKey(); | |||
final String path = validateUpdatePath(UpdateOperator.POP, entry.getKey()); |
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.
Was missing verification we won't target _id -- would fail anyway as _id cannot be an Array, but Mongo catches immutability problem before structural difference.
*/ | ||
protected static String validateSetPath(UpdateOperator oper, String path) { | ||
protected static String validateUpdatePath(UpdateOperator oper, String path) { |
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.
Renamed since now used by all update operators.
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.
LGTM
LGTM 👍 |
What this PR does:
Supports dot-notation (nested paths) for
$inc
operator (currently only works on root-level properties).Which issue(s) this PR fixes:
Fixes #183
Checklist