From 33af8ce8e7a14cd9760e3e97cff3ff391ee0f444 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, 27 Mar 2025 17:36:51 -0400 Subject: [PATCH] allow nil `opts` to be passed to `Find*` model methods --- model.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model.go b/model.go index cab079d..43887f5 100644 --- a/model.go +++ b/model.go @@ -88,6 +88,9 @@ func (m *Model) getParsedIdxs() map[string][]InternalIndex { // FindRaw - find documents satisfying `query` and return a plain mongo cursor. func (m *Model) FindRaw(query interface{}, opts *options.FindOptionsBuilder) (*mongo.Cursor, error) { coll := m.getColl() + if opts == nil { + opts = options.Find() + } var fo options.FindOptions for _, setter := range opts.Opts { _ = setter(&fo)