Issue: Multiple fields with multiple filters loosing filters in DocumentState #2818
Unanswered
aj-swipejobs
asked this question in
Q&A
Replies: 1 comment · 9 replies
|
I would need to see your actual code but this looks like a big fixed in 2.4.11. If you could try that version to be sure the problem persists, we can dig a bit deeper. |
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
so when we have multiple filters for the same property we are loosing the first filter in the map. I have tracked it down to the class "DocumentState" method "andTogether".
eg. is let's say we have following filters.
"attrib_A": "$exists"
"attrib_A": "$ne: ''"
"attrib_B": "$exists"
"attrib_B": "$ne: ''"
Document state would loose "attrib_B": "$exists" in the "finished" map.
`
private Document andTogether(Document doc, String key, @nullable Object additional) {
in this code.
first filter
finished = {"attrib_A" : "$exists"}
second filter
finished = {"$and": ["attrib_A" : "$exists", "attrib_A" : "$ne: ''"]}
third filter
finished = {"$and": ["attrib_A" : "$exists", "attrib_A" : "$ne: ''"], "attrib_B": "$exists"}
fourth filter
'var extant = doc.remove(key);' this would remove "attrib_B": "$exists" and "if (and != null)" would be true so
finished = {"$and": ["attrib_A" : "$exists", "attrib_A" : "$ne: ''", "attrib_B": "$ne: ''"],}
Is this a bug or how it's suppose to work?
All reactions