Could use a hint on getting started with this one.
db.movies.aggregate([
{
$project: {
_id: 0,
highest: { $max: "$imdb.rating"}
}
}
])
^ First, just trying to get the max imdb rating of the entire collection. Thought this query would do it, but it’s returning the imdb rating for every movie in the collection.
db.movies.aggregate({ $group : { _id: null, max: { $max : "$imdb.rating" }}});
^ Then tried a group just for the heck of it, and the result is an empty string:
{ "_id" : null, "max" : "" }
Seems like this should be straight-forward.