Allow nil query in composer

v2 v2.0.3
Nikita Tokarchuk 4 years ago
parent eeb83daf4b
commit 9f647ca094
  1. 7
      mongox/query/compose.go

@ -26,6 +26,10 @@ func Compose(filters ...interface{}) *Query {
// Push applies single filter to a query
func Push(q *Query, f interface{}) bool {
if f == nil {
return true
}
ok := false
ok = ok || applyBson(q, f)
ok = ok || applyLimit(q, f)
@ -91,9 +95,6 @@ func applyProtection(q *Query, f interface{}) bool {
x = &f.X
v = &f.V
case *protection.Key:
if f == nil {
return false
}
x = &f.X
v = &f.V

Loading…
Cancel
Save