title: Pymongo doing match project query
body: <p>I am having my mongodb query and trying to implement it using pymongo. The query is trying to do an aggregation.This works fine in mongodb robomongo. When trying to implement the same with pymongo in python, i am getting errors</p>
  <pre><code>db.collection.aggregate([
    {
      $match: {
        name: &quot;Sam&quot;
      }
    },
    {
      $project: {
        &quot;name&quot;: &quot;$name&quot;,
        &quot;technologies&quot;: {
          $map: {
            input: &quot;$technology&quot;,
            as: &quot;t&quot;,
            in: &quot;$$t.technologyName&quot;
          }
        }
      }
    }
  ]);
  </code></pre>
  <p>I have tried executing the same with pymongo</p>
  <pre><code>from pymongo import MongoClient
  connection_uri = f&quot;mongodb://{username}:{password}@{host}:{port}/{db_name}?{args}&quot;
  client = MongoClient(connection_uri)
  db = client[db_name]
  
  testCollection = db['artifactCollection']
  
  testCollection.aggregate([
    {
      &quot;$match&quot;: {
        &quot;name&quot; : &quot;Sam&quot;
      }
    },
    {
      &quot;$project&quot;: {
        &quot;technologies&quot;: {
          &quot;$map&quot;: {
            input: &quot;$technology&quot;,
            as: &quot;t&quot;,
            in: &quot;$$t.technologyName&quot;
          }
        },
        &quot;sectors&quot;: {
          &quot;$map&quot;: {
            input: &quot;$sector&quot;,
            as: &quot;s&quot;,
            in: &quot;$$s.sectorName&quot;
          }
        },
        &quot;accounts&quot;: {
          &quot;$map&quot;: {
            input: &quot;$account&quot;,
            as: &quot;a&quot;,
            in: &quot;$$a.accountName&quot;
          }
        },
        &quot;regions&quot;: {
          &quot;$map&quot;: {
            input: &quot;$region&quot;,
            as: &quot;r&quot;,
            in: &quot;$$r.regionName&quot;
          }
        }
      }
    }
  ]);
  </code></pre>
  <p>Giving me error.. I wanted to execute the query with pymongo.. I tried the query in robomongo and is working fine.</p>
  <pre><code>as: &quot;t&quot;,
       ^
  SyntaxError: invalid syntax
  </code></pre>