I want to insert 10000 data into the couchbase, but only part of data has been inserted successfully. I have tried several times and the number of data that has been inserted successfully is different everytime.
How can I insert all the data into couchbase?
bucket, _ := myCluster.OpenBucket("test", "")
for i := 0; i < 10000; i++ {
s := strconv.Itoa(i)
batch = append(batch, &gocb.UpsertOp{Key: s, Value: "test"})
}
err = bucket.Do(batch)
bucket.Close()
There is a pictures about the bucket.
Bucket after operation: