Skip to content
Snippets Groups Projects
Commit a2d0bee5 authored by Danis Kirasirov's avatar Danis Kirasirov
Browse files

delete comments

parent b02e1c7b
No related branches found
No related tags found
No related merge requests found
...@@ -672,19 +672,19 @@ func (c *compiler) handleLenNode(node *ast.BinaryNode) (result bson.M, ok bool) ...@@ -672,19 +672,19 @@ func (c *compiler) handleLenNode(node *ast.BinaryNode) (result bson.M, ok bool)
} }
switch node.Operator { switch node.Operator {
case "==": // + case "==":
if length == 0 { if length == 0 {
return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$eq": bson.A{}}}, true return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$eq": bson.A{}}}, true
} }
return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$size": length}}, true return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$size": length}}, true
case "!=": // + case "!=":
if length == 0 { if length == 0 {
return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$exists": true, "$type": "array", "$ne": bson.A{}}}, true return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$exists": true, "$type": "array", "$ne": bson.A{}}}, true
} }
return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$not": bson.M{"$size": length}}}, true return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$not": bson.M{"$size": length}}}, true
case ">": // + case ">":
if length == 0 { if length == 0 {
return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$exists": true, "$type": "array", "$ne": bson.A{}}}, true return bson.M{c.identifier(lenNode.Arguments[0]): bson.M{"$exists": true, "$type": "array", "$ne": bson.A{}}}, true
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment