From cd20d2c9eb12a715c05a4e106ec5692273d618ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 5 Sep 2024 17:56:44 -0400 Subject: [PATCH] change Query.Model to a pointer --- model.go | 4 ++-- query.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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