title: TypeError unhashable type: 'dict' using $elemMatch in count or find in Python
body: <p>The Users collection in the Mongo database contains records containing an element that is an array (SubscriptionSet) of dictionaries with pairs of values as shown below.</p>
  
  <pre><code>{
      "_id": {
          "$oid": "567019357a5c390d040cbbc2"
      },
      "EmailAddress": "joejane@myco.com",
      "SubscriptionSet": [
          {
              "SubscriptionId": 586102,
              "SeatState": "ASSIGNED"
          },
          {
              "SubscriptionId": 588972,
              "SeatState": "ASSIGNED"
          }
      ],
      "DisplayName": "Joe Jane",
      "SubscriberState": "ACTIVE"
  }
  </code></pre>
  
  <p>I want to find all users that have a SubscriptionId matching one of two values AND a SeatState that is not equal to ASSIGNED.  I am using the following find call.</p>
  
  <pre><code>GoodSubscriptions = [586102, 586104]
  db = client.bsssubscriptions
  Users = db.Users
  BadSubscriptions = Users.find({'$and': [{'SubscriberState': 'ACTIVE'}, {'SubscriptionSet': {'$elemMatch': {{'SubscriptionId': {'$in': GoodSubscriptions}}, {'SeatState': {'$ne': 'ASSIGNED'}}}}}]})
  </code></pre>
  
  <p>and get the following error:</p>
  
  <pre><code>  File "C:\Users\IBM_ADMIN\Desktop\BSS API\db query.py", line 24, in &lt;module&gt;
      BadVerse = Users.find({'SubscriptionSet': {'$elemMatch': {{'SubscriptionId': {'$in': GoodSubscriptions}}, {'SeatState': {'$ne': 'ASSIGNED'}}}}})
  TypeError: unhashable type: 'dict'
  </code></pre>
  
  <p>I have looked for this specific error and found many examples, but none were related to using a find with a records containing an array of dictionary pairs.</p>