你好我正在使用 golang 包“github.com/northwesternmutual/grammes”并且想要獲取字段而不僅僅是來(lái)自響應(yīng)客戶端的值所以我可以將它解碼為 jsondata, err := client.ExecuteQuery(g.V().Has("person", "name", "aksan").Values())if err != nil { log.Fatalf("Querying error: %s", err.Error())}var responseStruct map[string]interface{}err = json.Unmarshal(data[0], &responseStruct)if err != nil { log.Fatalf("unmarshal error: %s", err.Error())}// Log out the response.PrettyPrint(responseStruct["@value"], "result")回應(yīng)是[ { "@type": "g:Int64", "@value": 6 }, "p01", { "@type": "g:Int64", "@value": 10 }, "aksan", { "@type": "g:Int32", "@value": 29 }]我想要的是結(jié)果將顯示字段喜歡@fields 或類似這樣的東西[ "height":{ "@type": "g:Int64", "@value": 6 }, "code":"p01", "weight":{ "@type": "g:Int64", "@value": 10 }, "name":"aksan", "age":{ "@type": "g:Int32", "@value": 29 }]
- 1 回答
- 0 關(guān)注
- 101 瀏覽
添加回答
舉報(bào)
0/150
提交
取消