title: How to delete the document in Mongodb after 3 mins based on created time by Python
body: <p>This is my code:</p>
  
  <pre><code>timestamp = datetime.datetime.now()
  mongo.db.user.ensure_index("createAt", expireAfterSeconds=180)
  mongo.db.user.insert_one({'username':json['username'],'password':json['password'],"createAt": timestamp})
  </code></pre>
  
  <p>This above way deletes all the documents in the collection after 3 mins. I want to delete the specific user after 3 mins based on "createAt". </p>
  
  <p>Ex: </p>
  
  <pre><code>{ "_id" : ObjectId("5b73f30a7d1312555a4ea629"), "username" : "hanson01@gmail.com", "password" : "111111", "createAt" : ISODate("2018-08-15T09:30:00.066Z") }
  { "_id" : ObjectId("5b73f30a7d131255asdasdas"), "username" : "hanson02@gmail.com", "password" : "111111", "createAt" : ISODate("2018-08-15T09:31:00.066Z") }
  </code></pre>
  
  <p>The account with username hanson01@gmail.com will be deleted before hanson02@gmail.com</p>
  
  <p>Does anyone have any ideas?
  Thank you.</p>