We found strange problem with FetchOne when using LIMIT in query.
Code:
...
q := ara.NewQuery("FOR i IN cities LIMIT 0,5 RETURN i")
c, err := adb.DB("test").Execute(q)
if err != nil {
log.Fatalf("%s", err)
}
if c.Err {
log.Fatalf("error %s\n", c.ErrMsg)
}
var doc City
for c.FetchOne(&doc) {
log.Printf("%#v", doc)
}
It prints only first 4 items, because in cursor.go handling of Index and max in FetchOne is not correct.
We didn't test, but code in FetchBatch looks like it has same problem.
By looking in cursor.go - this would happen without limit too, last result would not be printed.
We found strange problem with FetchOne when using LIMIT in query. Code:
It prints only first 4 items, because in cursor.go handling of Index and max in FetchOne is not correct. We didn't test, but code in FetchBatch looks like it has same problem. By looking in cursor.go - this would happen without limit too, last result would not be printed.