What's the aggregation editor

Hi,

Is there any good aggregation editor/tool?

Thanks

Hi Jie,
Well, I’m using Visual Studio Code to edit/create the pipelines/queries:

db.movies.aggregate([
{
$match: {
cast: { $in: [
“Sandra Bullock”,
“Tom Hanks”,
“Julia Roberts”,
“Kevin Spacey”,
“George Clooney”]
},
countries: { $in: [“USA”] },
“tomatoes.viewer.rating”: { $gte: 3 }
}
},
{
$project: {
‘_id’: 0,
‘title’: 1,
num_favs: {
$size: {
$setIntersection: [
[
“Sandra Bullock”,
“Tom Hanks”,
“Julia Roberts”,
“Kevin Spacey”,
“George Clooney”
],
‘$cast’
]
}
},
rate: ‘$tomatoes.viewer.rating’
}
},
{
$sort: {
num_favs: -1,
rate: -1,
title: -1
}
},
{
$skip: 24
}
]);

Once I have it, I try it by copy/paste on the console.

Also, You can use the aggregation tools from mongoDB Compass, there you can add stage by stage to the aggregation pipeline.

If I’m not answer your request in a proper a way, please let me know. I’m learning English so, maybe I miss something.

Have a nice day!

Thanks. I would like some auto formatting which will have nice indent and syntax match/check, etc