Пример #1
0
 def update(collection: Collection, entry: DatabaseEntry):
     collection.update_one(entry.get_filter(), entry.get_data())
Пример #2
0
 def insert(collection: Collection, entry: DatabaseEntry):
     return collection.update_one(entry.get_filter(), {
         "$set": entry.get_data()
     },
                                  upsert=True).upserted_id