-
Notifications
You must be signed in to change notification settings - Fork 14
Fixes #298 #300
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
Fixes #298 #300
Conversation
|
Worth noting that we can probably make this change for array fields as well. I can either make it part of this PR or just merge this and I'll make another. |
| } else { | ||
| hidden.put(path.getLast(), val.toUpperCase()); | ||
| } | ||
| } |
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.
...else (if val==null) and if hidden_sub_path exists, remove the field from there
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.
Good catch. We didn't have that happening before and this logic makes it quite a bit easier to implement. I think there's another issue out there that we can close.
|
Lets make this for arrays as well |
Probably still needs a little code cleanup before merging.
|
I believe you're making this much more complicated than it needs to be. First, instead of strings for field names, use Path. Second, you don't need a Map for field and its corresponding hidden field. A list of fields |
|
@bserdar that's fair. I'm still spending some time cleaning this up. Let me take a look at the algo. |
| } else if (field.numSegments() == 1) { | ||
| DBObject docObj = (DBObject) doc; | ||
| if (docObj.get(field.head(0)) == null) { | ||
| // no value, so nothing to populate |
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.
Remove field from docObj.@hidden
Conflicts: mongo/src/main/java/com/redhat/lightblue/mongo/crud/IterateAndUpdate.java
No description provided.