title: MongoDB(py) - How to retreive data, modify it, update it?
body: <p>This is for MongoDB using python for a discord bot.
  I wanted to know how can I get a certain value from an ID, then I want to then modify that value and update it.</p>
  <p>//Here I set up the Database and Collection</p>
  <pre><code>db = client.mymongodatabase #Database
  mycol= db.mymongocollection #Collection in Database
  </code></pre>
  <p>//Here I make the entry into the Mongo Database Collection</p>
  <pre><code>@bot.event
  async def on_member_join(member):
    setupbank = ({&quot;_id&quot;:(str(member)), &quot;coinA&quot;:100, &quot;coinB&quot;:50,&quot;coinC&quot;:50,&quot;coinD&quot;:50})
    mycol.insert_one(setupbank)
  </code></pre>
  <p>//The Problem. I have a function that generates 4 random integers, one per coin type. But how can I retrieve the coin data and add the random earnings to the existing values, and finally update the entry in the mongodb collection?</p>
  <pre><code>@bot.command()
  async def roll(ctx):
    coinAearn= random.randint(1,100)
    coinBearn= random.randint(1,100)
    coinCearn= random.randint(1,100)
    coinDearn= random.randint(1,100)
  </code></pre>