-
Notifications
You must be signed in to change notification settings - Fork 258
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
More complex documents can not be queried properly #143
Comments
On further comparison of the objects created by direct initialization and
which is, IMHO, rather unintuitive. |
Hello! Terribly sorry about the inconvenience, here's the culprit: https://github.com/HouzuoGuo/tiedot/blob/master/db/doc.go#L14 The function works very well for JSON documents deserialised from string, but as you have observed, unfortunately it does not have a match for Reflection may come in handy in this case, but I have yet to understand the performance implication of reflection vs type matching. |
Thanks for the explanation. On a second thought this might be not that big of a problem in practice as people will be mostly (i would guess) piping the structs to be stored via I found this when writing simple test program for tiedot evaluation and initialized Maybe it would make sense to mention this in documents (or embedded usage tutorial) somehow, but I do not have a good proposal how and where in particular. |
I'm experiencing strange behaviour when trying to query more complex JSON documents in embedded mode. When the document that is inserted inserted to tiedot is created from a string via json.Unmarshal() it can be queried successfully. In case it is created from a directly initialized object it can not be queried.
Example object is taken from the example in documentation:
Consider the following code snippet:
Query returns any data only in a case when jsonDoc is created as:
but does not work when created as:
From my understanding these two methods of creating jsonDoc are equivalent. What I'm missing?
The text was updated successfully, but these errors were encountered: