I need the pipeline to match documents where field 'modelName' is equal to 'movies' or 'tv_shows'. I tried the code below but it matches only 'tv_shows' and ignores 'movies'.
$match = array('$match' => array('modelName' => 'movies', 'modelName' => 'tv_shows'));
Whole script:
<?php
$connection = new MongoClient;
$collection = $connection -> selectDB("getglue") -> selectCollection("gg");
MongoCursor::$timeout = -1;
$match = array('$match' => array('modelName' => 'movies', 'modelName' => 'tv_shows'));
$group = array('$group' => array('_id' => '$title', 'total' => array('$sum' => 1)));
$sort = array('$sort' => array('total' => -1));
$limit = array('$limit' => 7);
$pipeline = array($match, $group, $sort, $limit);
$out = $collection -> aggregate($pipeline);
echo json_encode($out, JSON_PRETTY_PRINT);
?>