@@ -463,7 +463,7 @@ You can group by a field.
463463``` javascript
464464// score is the field. $ before score lets the database know this is a field
465465var pipeline = [
466- group: { objectId: ' $score' }
466+ { group: { objectId: ' $score' } }
467467];
468468var query = new Parse.Query (" User" );
469469query .aggregate (pipeline)
@@ -480,7 +480,7 @@ You can apply collective calculations like $sum, $avg, $max, $min.
480480``` javascript
481481// total will be a newly created field to hold the sum of score field
482482var pipeline = [
483- group: { objectId: null , total: { $sum: ' $score' } }
483+ { group: { objectId: null , total: { $sum: ' $score' } } }
484484];
485485var query = new Parse.Query (" User" );
486486query .aggregate (pipeline)
@@ -496,7 +496,7 @@ Project pipeline is similar to `keys` or `select`, add or remove existing fields
496496
497497``` javascript
498498var pipeline = [
499- project: { name: 1 }
499+ { project: { name: 1 } }
500500];
501501var query = new Parse.Query (" User" );
502502query .aggregate (pipeline)
@@ -528,7 +528,7 @@ You can match by comparison.
528528
529529``` javascript
530530var pipeline = [
531- match: { score: { $gt: 15 } }
531+ { match: { score: { $gt: 15 } } }
532532];
533533var query = new Parse.Query (" User" );
534534query .aggregate (pipeline)
@@ -582,4 +582,4 @@ query.readPreference(
582582 ' SECONDARY_PREFERRED' ,
583583 ' NEAREST'
584584);
585- ```
585+ ```
0 commit comments