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