A filter expression of "KEY EXISTS" fails, even though technically it does exist.
From what I can tell, matchExec sees KEY, and then goes ahead and does 2 more token gets, which are ":" followed by "{".
Something like this:
NEIL DEBUG testMap: map[[$%XDCRInternalKey%$]:TestDocKey Key:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA [$%XDCRInternalMeta%$]:map[AnotherXattr:TestValueString TestXattr:30]]
NEIL DEBUG Expr: $doc.[$%XDCRInternalMeta%$] EXISTS
NEIL DEBUG objStart going into objOrArray
NEIL DEBUG tokenData: "[$%XDCRInternalKey%$]"
NEIL DEBUG autostep tokenData: :
NEIL DEBUG autostep2 tokenData: "TestDocKey"
NEIL DEBUG KeyString: [$%XDCRInternalKey%$]
NEIL DEBUG tokenData: "Key"
NEIL DEBUG autostep tokenData: :
NEIL DEBUG autostep2 tokenData: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
NEIL DEBUG KeyString: Key
NEIL DEBUG tokenData: "[$%XDCRInternalMeta%$]"
NEIL DEBUG autostep tokenData: :
NEIL DEBUG autostep2 tokenData: {
NEIL DEBUG KeyString: [$%XDCRInternalMeta*%$]
NEIL DEBUG KeyString found with token: 1 tokenData: { keyElem: :ops
[0] @ exists @
So it sees that there is no operations for tokenData "{" and then bails, and the original [0] got lost.
Given a data structure of:
A filter expression of "KEY EXISTS" fails, even though technically it does exist. From what I can tell, matchExec sees KEY, and then goes ahead and does 2 more token gets, which are ":" followed by "{".
Something like this:
NEIL DEBUG testMap: map[[$%XDCRInternalKey%$]:TestDocKey Key:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA [$%XDCRInternalMeta%$]:map[AnotherXattr:TestValueString TestXattr:30]] NEIL DEBUG Expr: $doc.[$%XDCRInternalMeta%$] EXISTS NEIL DEBUG objStart going into objOrArray NEIL DEBUG tokenData: "[$%XDCRInternalKey%$]" NEIL DEBUG autostep tokenData: : NEIL DEBUG autostep2 tokenData: "TestDocKey" NEIL DEBUG KeyString: [$%XDCRInternalKey%$] NEIL DEBUG tokenData: "Key" NEIL DEBUG autostep tokenData: : NEIL DEBUG autostep2 tokenData: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" NEIL DEBUG KeyString: Key NEIL DEBUG tokenData: "[$%XDCRInternalMeta%$]" NEIL DEBUG autostep tokenData: : NEIL DEBUG autostep2 tokenData: { NEIL DEBUG KeyString: [$%XDCRInternalMeta*%$] NEIL DEBUG KeyString found with token: 1 tokenData: { keyElem: :ops [0] @ exists @
So it sees that there is no operations for tokenData "{" and then bails, and the original [0] got lost.