def update(collection: Collection, entry: DatabaseEntry): collection.update_one(entry.get_filter(), entry.get_data())
def insert(collection: Collection, entry: DatabaseEntry): return collection.update_one(entry.get_filter(), { "$set": entry.get_data() }, upsert=True).upserted_id