diff --git a/model.go b/model.go index 7ee7d2f..0b4163f 100644 --- a/model.go +++ b/model.go @@ -135,7 +135,7 @@ func (m *Model) Find(query interface{}, opts ...*options.FindOptions) (*Query, e qqv := reflect.New(qqt) qqv.Elem().Set(reflect.MakeSlice(qqt, 0, 0)) qq := &Query{ - Model: *m, + Model: m, Collection: m.getColl(), doc: qqv.Interface(), Op: OP_FIND_ALL, @@ -199,7 +199,7 @@ func (m *Model) FindOne(query interface{}, options ...*options.FindOneOptions) ( rawDoc: raw, doc: v.Elem().Interface(), Op: OP_FIND_ONE, - Model: *m, + Model: m, } qq.rawDoc = raw err = rip.Decode(qq.doc) diff --git a/query.go b/query.go index 308cbac..90423ae 100644 --- a/query.go +++ b/query.go @@ -20,7 +20,7 @@ type Query struct { // the operation from which this query stems Op string // the model instance associated with this query - Model Model + Model *Model done bool rawDoc any doc any