diff --git a/mongo/collection.go b/mongo/collection.go index 0e5bd2220b..e688904394 100644 --- a/mongo/collection.go +++ b/mongo/collection.go @@ -991,6 +991,9 @@ func (coll *Collection) FindOne(ctx context.Context, filter interface{}, Sort: opt.Sort, } } + // Unconditionally send a limit to make sure only one document is returned and the cursor is not kept open + // by the server. + findOpts = append(findOpts, options.Find().SetLimit(-1)) batchCursor, err := driver.Find( ctx, cmd,