Skip to content
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

Matcher doesn't perform EXIST correctly on key with value of embedded map #90

Closed
nelio2k opened this issue Feb 5, 2019 · 0 comments
Closed
Assignees
Labels

Comments

@nelio2k
Copy link
Collaborator

nelio2k commented Feb 5, 2019

Given a data structure of:

	userData := map[string]interface{}{
		"KEY": map[string]interface{}{
			"internalKey": "value",
		},
	}

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.

@nelio2k nelio2k added the bug label Feb 5, 2019
@nelio2k nelio2k self-assigned this Feb 5, 2019
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue May 2, 2019
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue May 3, 2019
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue May 7, 2019
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue May 10, 2019
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue May 13, 2019
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue May 13, 2019
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue May 13, 2019
… array

           Implemented obj and array fastval and comparisons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant