change Query.Model to a pointer

This commit is contained in:
parent 4297071b3b
commit cd20d2c9eb
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C
2 changed files with 3 additions and 3 deletions

@ -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)

@ -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