From 74489c7516ec9fcd5f2e79502c16900a254af647 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 27 Nov 2014 17:18:05 -0700 Subject: [PATCH] Clarify cursor behavior after mutation. --- cursor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cursor.go b/cursor.go index 90a1867..3bfc2f1 100644 --- a/cursor.go +++ b/cursor.go @@ -8,6 +8,10 @@ import ( // Cursor represents an iterator that can traverse over all key/value pairs in a bucket in sorted order. // Cursors see nested buckets with value == nil. // Cursors can be obtained from a transaction and are valid as long as the transaction is open. +// +// Changing data while traversing with a cursor may cause it to be invalidated +// and return unexpected keys and/or values. You must reposition your cursor +// after mutating data. type Cursor struct { bucket *Bucket stack []elemRef