Gocb sometime return empty result

here’s my &struct and query :

type Chat struct {
	Text 		string `json:"text"`
	Sender 	string `json:"sender"`
	Sentiment 	string `json:"sentiment"`
}

select text, sender, sentiment from bucket where obj_type = 0 and include_media = false and room_id = '6281383800060-29129' and timestamp > 1563321600

i don’t know why, with my GO SDK (gocb) sometime return expected result and sometime just empty result, but with Couchbase web interface, it’s always return expected result

  • i didn’t get any error from bucket.ExecuteN1qlQuery

fine, i move to use N1QL json api

gocb doesn’t return error when given struct has different type with returned json from couchbase

Hi @jihantoro after iterating the results are you checking the error returned from results.Close()? Any parsing errors will show up there rather than at ExecuteN1qlQuery as the query itself will have succeeded.

yes, i think this is parsing error issue