File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -195,8 +195,12 @@ Learn [when to use $addFields over $project](https://www.practical-mongodb-aggre
195195 ``` python
196196 most_authors = books.aggregate
197197 ([
198- { " $match" : { " year" : { " $gt" : 2000 } } },
199- { " $match" : { " authors" : { " $exists" : True } } },
198+ {
199+ " $match" : {
200+ " year" : { " $gt" : 2000 },
201+ " authors" : { " $exists" : True }
202+ }
203+ },
200204 {
201205 " $project" : {
202206 " title" : 1 ,
@@ -220,8 +224,11 @@ Learn [when to use $addFields over $project](https://www.practical-mongodb-aggre
220224 ``` python
221225 most_authors = books.aggregate
222226 ([
223- { " $match" : { " year" : { " $gt" : 2000 } } },
224- { " $match" : { " authors" : { " $exists" : True } } },
227+ {
228+ " $match" :
229+ { " year" : { " $gt" : 2000 } },
230+ { " authors" : { " $exists" : True } }
231+ },
225232 {
226233 " $addFields" : {
227234 " numAuthors" : { " $size" : " $authors" }
You can’t perform that action at this time.
0 commit comments