title: Rocket.Chat API queries with MongoDB Query Selectors fails
body: <p>Retrieve users via Rocket.Chat API filtered by <code>roles</code> (membership) does not work.</p>
  <p>I want to retrieve users via Python using the Rocket.Chat API. For this I use the <a href="https://github.com/jadolg/rocketchat_API" rel="nofollow noreferrer">Python API wrapper rocketchat_API</a> mentioned in the <a href="https://developer.rocket.chat/reference/api/rest-api" rel="nofollow noreferrer">Rocket.Chat Docs</a>.</p>
  <p>Querying users works in general. It is possible to filter by only active users, however an error appears when I want to filter by non-membership of a role.</p>
  <p><strong>I want to query all active users which are not admin role.</strong></p>
  <p>The API connection and the user query works:</p>
  <pre class="lang-py prettyprint-override"><code>pQuery = { 'active': True, 'roles': 'admin' }
  
  api = RocketChat(auth_token=rcToken, user_id=rcUserId, server_url=rcUrl)
  response = api.users_list(offset=0, count=100, query=json.dumps(pQuery))
  </code></pre>
  <p>This code lists all active admin users.</p>
  <p>In the Rocket.Chat Docs I found <a href="https://developer.rocket.chat/reference/api/rest-api/endpoints/other-important-endpoints/query-and-fields-info" rel="nofollow noreferrer">Query and Fields</a>, here <a href="https://www.mongodb.com/docs/manual/reference/operator/query/#comparison" rel="nofollow noreferrer">MongoDB Query Selectors</a> are mentioned. I tried the <a href="https://www.mongodb.com/docs/manual/reference/operator/query/nin/#select-on-elements-not-in-an-array" rel="nofollow noreferrer">Not in an array selector <code>$nin</code></a>.</p>
  <p>I tried to query via <code>$nin</code> in different variations:</p>
  <pre class="lang-py prettyprint-override"><code>pQuery = { 'active': True, 'roles': { '$nin': ['admin'] } }
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>pQuery = { 'active': True, 'roles': { '$nin': 'admin' } }
  </code></pre>
  <p><code>json.dumps(pQuery)</code> returns string as expected, e.g.:</p>
  <pre><code>{&quot;active&quot;: true, &quot;roles&quot;: {&quot;$nin&quot;: [&quot;admin&quot;]}}
  </code></pre>
  <p>But always I get the error message:</p>
  <pre><code>{'success': False, 'error': 'Invalid attribute: roles.$nin [error-invalid-query]', 'errorType': 'error-invalid-query'}
  </code></pre>