Skip to content

query.aggregate() doesn't need find() #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions _includes/js/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ var pipeline = [
group: { objectId: '$score' }
];
var query = new Parse.Query("User");
query.aggregate(pipeline);
query.find()
query.aggregate(pipeline)
.then(function(results) {
// results contains unique score values
})
Expand All @@ -480,8 +479,7 @@ var pipeline = [
group: { objectId: null, total: { $sum: '$score' } }
];
var query = new Parse.Query("User");
query.aggregate(pipeline);
query.find()
query.aggregate(pipeline)
.then(function(results) {
// results contains sum of score field and stores it in results[0].total
})
Expand All @@ -497,8 +495,7 @@ var pipeline = [
project: { name: 1 }
];
var query = new Parse.Query("User");
query.aggregate(pipeline);
query.find()
query.aggregate(pipeline)
.then(function(results) {
// results contains only name field
})
Expand All @@ -514,8 +511,7 @@ var pipeline = [
{ match: { name: 'BBQ' } }
];
var query = new Parse.Query("User");
query.aggregate(pipeline);
query.find()
query.aggregate(pipeline)
.then(function(results) {
// results contains name that matches 'BBQ'
})
Expand All @@ -531,8 +527,7 @@ var pipeline = [
match: { score: { $gt: 15 } }
];
var query = new Parse.Query("User");
query.aggregate(pipeline);
query.find()
query.aggregate(pipeline)
.then(function(results) {
// results contains score greater than 15
})
Expand Down