Retrieve the fields info from the type elem but not the value elem

v2
Nikita Tokarchuk 3 years ago
parent 04382db4cd
commit e52b1bcc8a
No known key found for this signature in database
GPG Key ID: C4378F005530EDF2
  1. 6
      mongox/database/database.go

@ -126,8 +126,12 @@ func (d *Database) createAggregateLoad(target interface{}, composed *query.Query
pipeline = append(pipeline, primitive.M{"$limit": *composed.Limiter()})
}
el := reflect.ValueOf(target).Elem()
el := reflect.ValueOf(target)
elType := el.Type()
if elType.Kind() == reflect.Ptr {
elType = elType.Elem()
}
numField := elType.NumField()
preloads, _ := composed.Preloader()

Loading…
Cancel
Save