mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-05-22 15:53:36 +00:00
Override cursor Next function with a wrapper
This commit is contained in:
@@ -38,6 +38,17 @@ func (l *ManyLoader) GetNext() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Next loads next documents but doesn't perform decoding
|
||||
func (l *ManyLoader) Next() error {
|
||||
|
||||
hasNext := l.Cursor.Next(l.ctx)
|
||||
if !hasNext {
|
||||
return errors.NotFoundErrorf("%s", mongo.ErrNoDocuments)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close cursor
|
||||
func (l *ManyLoader) Close() error {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user