Add FindOptions

This commit is contained in:
George Suntres
2026-04-18 12:11:00 -04:00
parent 7599b8b856
commit 6e91f84750
4 changed files with 34 additions and 6 deletions

26
cursor_test.go Normal file
View File

@@ -0,0 +1,26 @@
package mongo
import (
"time"
"testing"
"go.mongodb.org/mongo-driver/v2/bson"
)
func TestCursor_Default(t *testing.T) {
now := time.Now()
oid := bson.NewObjectIDFromTimestamp(now)
okey := EncodeCursor(oid)
id, err := DecodeCursor(okey)
if err != nil {
t.Fatalf("Decode failed: %v", err)
}
if id != oid {
t.Fatalf("Failed to decode id")
}
}