How to filter json of string using gjson?

var sms = {id: "test006", collection:"carC",latitude:8.556525,longitude:76.872891}

result:= gjson.Get(sms,“id”).string()

OUTPUT: nothing

above two lines are rough code.
package name:“github.com/tidwall/gjson

Your JSON isn’t valid.

It seems that the library you are using is missing the opportunity to communicate those parse errors.

2 Likes

sorry for that @NobbZ .
{“id”: “278c924b-73a9-427a-b2f2-718f29f3db66”,“collection”:“5f56d384-e1b3-4388-b24a-61c164cd51c3”,“latitude”:11.557536364562386,“longitude”:104.89814115365569}. could you pleace check on this json …?

Assuming the “smartquotes” are proper doublequotes (please us backticks ` to wrap code in the future), it looks syntactically valid on a first glance.

1 Like

Thanks bro, it worked