code: def upsert_single(db, collection, object, match_params=None):
          
          return str(db[collection].update_one(match_params, {"$set": object}, upsert=True).upserted_id)
docs: Wrapper for pymongo.update_one()
          :param db: db connection
          :param collection: collection to update
          :param object: the modifications to apply
          :param match_params: a query that matches the documents to update
          :return: id of updated document