allow nil opts
to be passed to Find*
model methods
This commit is contained in:
parent
0a8f703eae
commit
33af8ce8e7
3
model.go
3
model.go
@ -88,6 +88,9 @@ func (m *Model) getParsedIdxs() map[string][]InternalIndex {
|
|||||||
// FindRaw - find documents satisfying `query` and return a plain mongo cursor.
|
// FindRaw - find documents satisfying `query` and return a plain mongo cursor.
|
||||||
func (m *Model) FindRaw(query interface{}, opts *options.FindOptionsBuilder) (*mongo.Cursor, error) {
|
func (m *Model) FindRaw(query interface{}, opts *options.FindOptionsBuilder) (*mongo.Cursor, error) {
|
||||||
coll := m.getColl()
|
coll := m.getColl()
|
||||||
|
if opts == nil {
|
||||||
|
opts = options.Find()
|
||||||
|
}
|
||||||
var fo options.FindOptions
|
var fo options.FindOptions
|
||||||
for _, setter := range opts.Opts {
|
for _, setter := range opts.Opts {
|
||||||
_ = setter(&fo)
|
_ = setter(&fo)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user