tidwall / sjson

Set JSON values very quickly in Go
MIT License
2.4k stars 165 forks source link

when i update to 1.1.0, error #36

Closed chenyiping111 closed 4 years ago

chenyiping111 commented 4 years ago

{ "_source": [ "_id" ], "from": 0, "query": { "bool": { "must_not": [ { "term": { "is_deleted": true } } ], "filter": [ { "terms": { "_id": [ "56d87325dabfae2eee03f325", "58774c630a3ac5b5de64f6a2" ] } } ] } }, "size": 1000,} "aggs": { "sample": { "aggs": { "org": { "terms": { "field": "authors.org.keyword", "execution_hint": "map", "size": 20 } } } } } }

when i use SetRaw(str,"aggs",aggStr) it return me result above.

chenyiping111 commented 4 years ago

there is a no need "}" after ""size": 1000," can you repair it ?

tidwall commented 4 years ago

Can you provide a reproducible example that includes the JSON before calling SetRaw, the SetRaw command that you used, and the result?

tidwall commented 4 years ago

I found the problem and pushed a fix. Thanks for reporting.