Context
xxxxxxxxxx
"overview": "Minutes after Laurie Strode, her daughter Karen and granddaughter Allyson left masked monster Michael Myers caged and burning in Laurie's basement, Laurie is rushed to the hospital with life-threatening injuries, believing she finally killed her lifelong tormentor. But when Michael manages to free himself from Laurie's trap, his ritual bloodbath resumes. As Laurie fights her pain and prepares to defend herself against him, she inspires all of Haddonfield to rise up against their unstoppable monster. The Strode women join a group of other survivors of Michael's first rampage who decide to take matters into their own hands, forming a vigilante mob that sets out to hunt Michael down, once and for all.",
{
"movies": [
{
"language": "en",
"title": "Avatar",
"popularity": 374.059,
"release_date": "2009-12-10",
"vote_average": 7.5,
"vote_count": 24280,
"genre": "['Action', 'Adventure', 'Fantasy', 'Science Fiction']",
"overview": "In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization.",
"revenue": 2847246203,
"runtime": 162,
"tagline": "Enter the World of Pandora."
},
{
"language": "en",
"title": "Avengers: Endgame",
"popularity": 193.86,
"release_date": "2019-04-24",
"vote_average": 8.3,
"vote_count": 19434,
"genre": "['Adventure', 'Science Fiction', 'Action']",
"overview": "After the devastating events of Avengers: Infinity War, the universe is in ruins due to the efforts of the Mad Titan, Thanos. With the help of remaining allies, the Avengers must assemble once more in order to undo Thanos' actions and restore order to the universe once and for all, no matter what consequences may be in store.",
"revenue": 2797800564,
"runtime": 181,
"tagline": "Part of the journey is the end."
},
{
"language": "en",
"title": "Avengers: Infinity War",
"popularity": 307.188,
"release_date": "2018-04-25",
"vote_average": 8.3,
"vote_count": 23027,
"genre": "['Adventure', 'Action', 'Science Fiction']",
"overview": "As the Avengers and their allies have continued to protect the world from threats too large for any one hero to handle, a new danger has emerged from the cosmic shadows: Thanos. A despot of intergalactic infamy, his goal is to collect all six Infinity Stones, artifacts of unimaginable power, and use them to inflict his twisted will on all of reality. Everything the Avengers have fought for has led up to this moment - the fate of Earth and existence itself has never been more uncertain.",
"revenue": 2046239637,
"runtime": 149,
"tagline": "An entire universe. Once and for all."
},
{
"language": "en",
"title": "The Avengers",
"popularity": 209.584,
"release_date": "2012-04-25",
"vote_average": 7.7,
"vote_count": 25642,
"genre": "['Science Fiction', 'Action', 'Adventure']",
Expression
xxxxxxxxxx
{
best_vote: movies
| sortByAttribute('vote_average', -1)
| first
| apply({title: this.title, note: this.vote_average}),
in_french_movies: movies
| filter(this.language == 'fr')
# take half of the films only
| apply(this | range(0, this | len // 2))
| pick('title'),
# sort by popularity, then take first and last elements
least_and_most_popular: movies
| sortByAttribute('popularity')
| apply([this | first, this | last])
| map({title: this.title, popularity: this.popularity, note: this.vote_average}),
most_revenue: movies
| sortByAttribute('revenue', -1)
| first
| apply({title: this.title, revenue: '$' + this.revenue | toString}),
nb_thrillers: movies
| filter(this.genre | contains('Thriller'))
| len,
# titles that do not contain latin characters
non_latin: movies
| reduce(
[],
(!(this.title ~ /[a-zA-Z]/)) ? acc | push(this.title) : acc
),
oldest: movies
Result
x
48
{
"best_vote": {
"note": 8.5,
"title": "僕のヒーローアカデミア THE MOVIE ヒーローズ:ライジング"
},
"in_french_movies": [
"BAC Nord",
"Miraculous World: Shanghai, la légende de Ladydragon",
"Ava"
],
"least_and_most_popular": [
{
"note": 7.3,
"popularity": 144.236,
"title": "Vacation Friends"
},
{
"note": 6.8,
"popularity": 5401.308,
"title": "Venom: Let There Be Carnage"
}
],
"most_revenue": {
"revenue": "$2847246203",
"title": "Avatar"
},
"nb_thrillers": 54,
"non_latin": [
"劇場版「鬼滅の刃」無限列車編",