Skip to content

Commit

Permalink
fix Mongo test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpeterkort committed Jul 17, 2024
1 parent f0f1023 commit 2148c7b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mongo/has_evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ func convertCondition(cond *gripql.HasCondition, not bool) bson.M {
var key string
var val interface{}
key = ToPipelinePath(cond.Key)
val = cond.Value.AsInterface()
val = cond.Value.AsInterface
// Adds new behavior in float64 type casting that casts nil values to 0
if val == nil &&
cond.Condition != gripql.Condition_EQ &&
cond.Condition != gripql.Condition_NEQ &&
cond.Condition != gripql.Condition_WITHIN &&
cond.Condition != gripql.Condition_WITHOUT &&
cond.Condition != gripql.Condition_CONTAINS &&
!not {
val = 0
}
expr := bson.M{}
switch cond.Condition {
case gripql.Condition_EQ:
Expand Down

0 comments on commit 2148c7b

Please sign in to comment.