diff --git a/pkg/expr/mongo.go b/pkg/expr/mongo.go
index 303ec12538c99eeb2048689bd97e5225f2352b6a..3cdbf0452c285402f64600b008bafd572045bd99 100644
--- a/pkg/expr/mongo.go
+++ b/pkg/expr/mongo.go
@@ -214,7 +214,7 @@ func (c *compiler) UnaryNode(node *ast.UnaryNode) interface{} {
 			return bson.M{c.identifier(nodeIn.Left): bson.M{"$nin": c.eval(nodeIn.Right)}}
 		}
 
-		return bson.M{"$not": c.compile(node.Node)}
+		return bson.M{"$nor": bson.A{c.compile(node.Node)}}
 	default:
 		panic(fmt.Sprintf("unknown operator (%v)", node.Operator))
 	}
diff --git a/pkg/expr/mongo_test.go b/pkg/expr/mongo_test.go
index 3e77e0d4ac56e27454a0239c089d866403e30d20..c8f8d4baf7a7a6b672452310705dfb3e20d61e06 100644
--- a/pkg/expr/mongo_test.go
+++ b/pkg/expr/mongo_test.go
@@ -52,6 +52,8 @@ func TestConvertToMongo(t *testing.T) {
 		{"iendsWith", "iendsWith(s, 'some')", nil, bson.M{"s": bson.M{"$regex": ".*some$", "$options": "i"}}, false},
 		{"iendsWith . + () $ {} ^", "iendsWith(s,'. + () $ {} ^')", nil, bson.M{"s": bson.M{"$regex": ".*\\. \\+ \\(\\) \\$ \\{\\} \\^$", "$options": "i"}}, false},
 		{"or", "s==2 || s > 10", nil, bson.M{"$or": bson.A{bson.M{"s": 2}, bson.M{"s": bson.M{"$gt": 10}}}}, false},
+		{"not#1", "not icontains(s, 'some')", nil, bson.M{"$nor":bson.A{bson.M{"s":bson.M{"$options":"i", "$regex":"some"}}}}, false},
+		{"not#2", "not (s.test > 3)", nil, bson.M{"$nor": bson.A{bson.M{"s.test": bson.M{"$gt": 3}}}}, false},
 		{"search", "search('some') || s > 10", nil, bson.M{"$or": bson.A{bson.M{"$text": bson.M{"$search": "some"}}, bson.M{"s": bson.M{"$gt": 10}}}}, false},
 		{"vars:or", "s== a + 2 || s > a + 10", map[string]interface{}{"a": 100}, bson.M{"$or": bson.A{bson.M{"s": 102}, bson.M{"s": bson.M{"$gt": 110}}}}, false},
 		{"near", "near(a, [55.5, 37.5], 1000)", map[string]interface{}{"a": []interface{}{55, 37}}, bson.M{"a.geometry": bson.M{"$near": bson.D{{Key: "$geometry", Value: map[string]interface{}{"coordinates": []interface{}{55.5, 37.5}, "type": "Point"}}, {Key: "$maxDistance", Value: 1000}}}}, false},