Closed ghost closed 2 years ago
The findResult
is a FindResult struct, that is what is returned by PostFind.
Thanks Rich for your quick reply. Actually I am getting 'Docs' from FindResult struct and want to have docs values in my customized struct where i can apply my logic.
Actually I am getting 'Docs' from FindResult struct and want to have docs values in my customized struct where i can apply my logic.
Sorry that wasn't clear to me from the original question.
You have 2 choices:
Document
struct type and use GetProperty
/GetProperties
to retrieve the properties you need and apply them to your own struct type.PostFindAsStream
to bypass the built-in types and deserialize directly into your own structs.
I am unable to convert the response into struct. below is my code .. findResult, , err := dbClient.PostFind(postFindOptions) if err != nil { fmt.Println("err", err) } b, := json.MarshalIndent(findResult, "", " ")
how can we convert findResult into struct? please suggest the solution.
Thanks in advanced!