@@ -101,27 +101,21 @@ Behavior
101
101
$filter: {
102
102
input: [ 1, "a", 2, null, 3.1, NumberLong(4), "5" ],
103
103
as: "num",
104
- cond: { $and: [
105
- { $gte: [ "$$num", NumberLong("-9223372036854775807") ] },
106
- { $lte: [ "$$num", NumberLong("9223372036854775807") ] }
107
- ] }
104
+ cond: { $isNumber: "$$num" }
108
105
}
109
106
}
110
107
111
108
- ``[ 1, 2, 3.1, NumberLong(4) ]``
112
109
113
110
* - .. code-block:: javascript
114
111
:copyable: false
115
- :emphasize-lines: 9
112
+ :emphasize-lines: 6
116
113
117
114
{
118
115
$filter: {
119
116
input: [ 1, "a", 2, null, 3.1, NumberLong(4), "5" ],
120
117
as: "num",
121
- cond: { $and:[
122
- { $gte: [ "$$num", NumberLong("-9223372036854775807") ] },
123
- { $gte: [ "$$num", NumberLong("9223372036854775807") ] }
124
- ] }
118
+ cond: { $isNumber: "$$num" },
125
119
limit: 2
126
120
}
127
121
}
@@ -130,17 +124,14 @@ Behavior
130
124
131
125
* - .. code-block:: javascript
132
126
:copyable: false
133
- :emphasize-lines: 9
127
+ :emphasize-lines: 6
134
128
135
129
{
136
130
$filter: {
137
131
input: [ 1, "a", 2, null, 3.1, NumberLong(4), "5" ],
138
132
as: "num",
139
- cond: { $and:[
140
- { $gte: [ "$$num", NumberLong("-9223372036854775807") ] },
141
- { $gte: [ "$$num", NumberLong("9223372036854775807") ] }
142
- ] }
143
- limit: { $add: [ 0, 1 ]}
133
+ cond: { $isNumber: "$$num" },
134
+ limit: { $add: [ 0, 1 ] }
144
135
}
145
136
}
146
137
0 commit comments