Hi we want to use go sdk for bulk operations like below example:
Here is the sample code we written:
docIds := []string{"foo", "bar", "baz"}
var bulkOps = make([]gocb.BulkOp, 0, len(keys))
for _, id := range docIds {
getOp := gocb.GetOp{
ID: id,
}
bulkOps = append(bulkOps, &getOp)
}
_ = c.collection.Do(bulkOps, nil)
// Is bulkOps sorted by doc ids we gave?
for _, item := range bulkOps {
...
}
Our question is, after
c.collection.Do(bulkOps, nil)
is it guaranteed that the order of bulkOps slice remains same (for instance for above example: with keys “foo”, “bar” and “baz” respectively)?
The reason we ask is that we may sort getResults unnecessarily and we have not seen clear documentation about that.