title: pymongo key_or_list must be an instance of list
body: <p>could somebody please help me and tell me how i can fix this pymongo error?</p>
  <pre class="lang-py prettyprint-override"><code>  cluster = pymongo.MongoClient(&quot;xxx&quot;)
    db = cluster['Coins']
    ada_db = db['ada']
    eos_db = db['eos']
    miota_db = db['miota']
    nano_db = db['nano']
    xrp_db = db['xrp']
    xmr_db = db[&quot;xmr&quot;]
  
    BTC = getPrice(&quot;BTC&quot;)
    ETH = getPrice(&quot;ETH&quot;)
    XRP = getPrice(&quot;XRP&quot;)
    EOS = getPrice(&quot;EOS&quot;)
    ADA = getPrice(&quot;ADA&quot;)
    IOTA =getPrice(&quot;IOTA&quot;)
    NANO =getPrice(&quot;NANO&quot;)
    XMR = getPrice(&quot;XMR&quot;)
  
    ada_db.insertOne({'_id': (ada_db.find({}).sort({&quot;_id&quot;:-1}).limit(1) + 1), 'value': ADA})
    eos_db.insertOne({'_id': (eos_db.find({}).sort({&quot;_id&quot;:-1}).limit(1) + 1), 'value': EOS})
    miota_db.insertOne({'_id': (miota_db.find({}).sort({&quot;_id&quot;:-1}).limit(1) + 1), 'value': IOTA})
    nano_db.insertOne({'_id': (nano_db.find({}).sort({&quot;_id&quot;:-1}).limit(1) + 1), 'value': NANO})
    xrp_db.insertOne({'_id': (xrp_db.find({}).sort({&quot;_id&quot;:-1}).limit(1) + 1), 'value': XRP})
    xmr_db.insertOne({'_id': (xmr_db.find({}).sort({&quot;_id&quot;: -1}).limit(1) + 1), 'value': XMR})
  </code></pre>
  <pre><code>TypeError: if no direction is specified, key_or_list must be an instance of list
  </code></pre>
  <p>would be cool if you can help me :smile:</p>
  <pre class="lang-py prettyprint-override"><code>ada_db.insertOne({'_id': (ada_db.find({}).sort({&quot;_id&quot;:-1}).limit(1) + 1), 'value': ADA})
  </code></pre>
  <p>this is where pycharm marks the error</p>
  <pre><code>    ada_db.insertOne({'_id': (ada_db.find({}).sort({&quot;_id&quot;:-1}).limit(1) + 1), 'value': ADA})
    File &quot;C:\Users\brend\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\cursor.py&quot;, line 762, in sort
      keys = helpers._index_list(key_or_list, direction)
    File &quot;C:\Users\brend\AppData\Local\Programs\Python\Python39\lib\site-packages\pymongo\helpers.py&quot;, line 74, in _index_list
      raise TypeError(&quot;if no direction is specified, &quot;
  TypeError: if no direction is specified, key_or_list must be an instance of list```
  </code></pre>