allow nil opts to be passed to Find* model methods

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-03-27 17:36:51 -04:00
parent 0a8f703eae
commit 33af8ce8e7
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

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