mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-07-03 17:22:33 +00:00
Do not increase offset if obj was not appended
This commit is contained in:
@@ -53,6 +53,8 @@ func LoadArray(db *mongox.Database, target interface{}, filters ...interface{})
|
|||||||
elem := reflect.New(targetSliceElemT.Elem())
|
elem := reflect.New(targetSliceElemT.Elem())
|
||||||
if result.Decode(elem.Interface()) != nil {
|
if result.Decode(elem.Interface()) != nil {
|
||||||
targetSliceV = reflect.Append(targetSliceV, elem)
|
targetSliceV = reflect.Append(targetSliceV, elem)
|
||||||
|
} else {
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result.Decode(targetSliceV.Index(i).Interface())
|
result.Decode(targetSliceV.Index(i).Interface())
|
||||||
|
|||||||
Reference in New Issue
Block a user