@ -129,7 +129,7 @@ func (d *Database) createAggregateLoad(target interface{}, composed *query.Query
el := reflect.ValueOf(target).Elem()
elType := el.Type()
numField := elType.NumField()
_, preloads := composed.Preloader()
preloads, _ := composed.Preloader()
for i := 0; i < numField; i++ {
@ -37,7 +37,7 @@ func (d *Database) LoadArray(target interface{}, filters ...interface{}) (err er
}
zeroElem := reflect.Zero(targetSliceElemT)
hasPreloader, _ := composed.Preloader()
_, hasPreloader := composed.Preloader()
ctx := query.WithContext(d.Context(), composed)
var result *mongox.Cursor
@ -16,7 +16,7 @@ func (d *Database) LoadOne(target interface{}, filters ...interface{}) (err erro
return
@ -15,7 +15,7 @@ func (d *Database) LoadStream(target interface{}, filters ...interface{}) (loade
var cursor *mongox.Cursor
@ -76,10 +76,10 @@ func (q *Query) Updater() (update primitive.A) {
// Preloader is a preloader list for a query
func (q *Query) Preloader() (ok bool, preloads []string) {
func (q *Query) Preloader() (preloads []string, ok bool) {
if q.preloader == nil {
return false, nil
return nil, false
preloads = q.preloader.Preload()