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