Questions tagged [gocb]
12 questions
6
votes
1 answer
go couchbase (gocb) error - ambiguous timeout or unambiguous timeout
I just getting started with Couchbase in Go, using the library gocb.
Just as a proof of concept trying to query my server for a specific ID and get a result. Here is a modified code sample below.
cOpts := gocb.ClusterOptions{
Authenticator:…

Keith E. Truesdell
- 552
- 11
- 21
2
votes
1 answer
Updating fields of a Couchbase document if it exists by Go
I am using gocb library. I want to update specific field of a document.
However if the document does not exist, I don't want to do anything I will just produce an error message.
You can say that first retrieve the full document itself and make…

javac
- 441
- 4
- 20
2
votes
1 answer
Any example for combining geo location search query with distance filter/sorting?
I am using gocb to query documents based on geo location . So far NewGeoDistanceQuery works well with the index. Now i need to sort the result based on geo location distance . According to the doc in here , it says i need to pass sort parameter…

sh0umik
- 1,549
- 2
- 17
- 27
1
vote
1 answer
Couchbase gocb bulk operation delivers partially empty results
In our go code using gocb we're querying a view that returns 32k ids. We then perform a bulk query (see code below) like explained in a CouchBase blog post. However, we only get partial results. We can see that ruleset, _ :=…

user208383
- 107
- 1
- 2
- 7
1
vote
1 answer
How to check if couchbase document exists, without retrieving full content, using golang SDK?
In my code I want to do or not to do some actions depending on document with given key existence. But can't avoid additional network overhead retrieving all document content.
Now I'm using
cas, err := bucket.Get(key, &value)
And looking for err ==…

mind_religion
- 75
- 1
- 10
1
vote
1 answer
Distinguish subdoc operation errors from missing data on certain path
I've got this code
frag, err := bucket.LookupIn(req.Key).Get(req.Path).Execute()
if err != nil {
res.Code = 1
res.What = err.Error()
} else {
frag.Content(req.Path, &res.Data)
}
If I'm trying to request some path which does not exist in…

Denis Sheremet
- 2,453
- 2
- 18
- 34
1
vote
2 answers
gocb: bulk insert into couchbase using golang- entire data is not being inserted
I am creating JSON Data (approx. 5000 records) in my SQL server instance and trying to Insert it into couchbase bucket using bulk insert operation in golang. The problem here is that entire data is not being pushed and a random number of records…

Krishan Jangid
- 75
- 7
1
vote
1 answer
Consisntent N1QL Query Couchbase GOCB sdk
I'm currently implementing EventSourcing for my Go Actor lib.
The problem that I have right now is that when an actor restarts and need to replay all it's state from the event journal, the query might return inconsistent data.
I know that I can…

Roger Johansson
- 22,764
- 18
- 97
- 193
0
votes
1 answer
why format of time changes in JSON binding?
i have created a struct and it contains two time.Time formatted fields, named with json tags: start_time and end_time.
type MyStruct struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
when i'm trying…

Hamzah Moazedy
- 61
- 4
0
votes
0 answers
gocb access to contents []byte in results.go in package gocb
Is there a was to access the []byte field of the Couchbase implementation in goLang or define a generic struct?
Use-case Not knowing the returned structure type at query time.
->Following code is not fully complete but should show what i'm…

ASH
- 980
- 1
- 9
- 22
0
votes
0 answers
How to configure bucket name during building query to couchbase via gocb
I need to select all agents from couchbase bucket. I am using https://github.com/couchbase/gocb package to work with couchbase.
My current query looks like:
SELECT a.* FROM `agents` a WHERE a.type=$1
But I feel I need to replace bucket name with…

J Sorel
- 343
- 2
- 18
-4
votes
1 answer
Strange behaviour GoLang limits storing of string into a variable to 64 bytes length
I have been trying to store a large string into a string variable in GoLang , but for some unknown reason GoLang is limiting the string to 64 Bytes in length
The main purpose of this string concatenation is to generate a couchbase's N1QL query at…

Sudesh Gutta
- 47
- 8