Hi. I am at my wit’s end. The following pipeline does not work. I cannot even assign this as a pipeline, because I am receiving the error:
SyntaxError: illegal character :
@(shell):8:0
I cannot locate my error. My code s below:
var pipeline = [
{
$match : {
countries : "USA",
"tomatoes.viewer.rating" : { $gte : 3 },
cast: {
$in : [
“Sandra Bullock”,
“Tom Hanks”,
“Julia Roberts”,
“Kevin Spacey”,
“George Clooney”
]
}
}
},
{
$project : {
title : 1,
cast : 1,
"tomatoes.viewer.rating" : 1,
_id : 0
}
},
{
$addFields : {
num_favs : {
$size : {
$setIntersection : [
[
“Sandra Bullock”,
“Tom Hanks”,
“Julia Roberts”,
“Kevin Spacey”,
“George Clooney”
],
"$cast"
]
}
}
}
},
{
$sort: {
num_favs : -1,
"tomatoes.viewer.rating" : -1,
title : -1
}
}
]
I’d greatly appreciate being pointed in the right direction.