Przeglądaj źródła

Find_and_modify is more suited for edits

oz123 10 lat temu
rodzic
commit
5d1f4571ab
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      pwman/data/drivers/mongodb.py

+ 1 - 1
pwman/data/drivers/mongodb.py

@@ -86,7 +86,7 @@ class MongoDB(Database):
         return tags
 
     def editnode(self, nid, **kwargs):
-        self._db.nodes.update({'_id': nid}, { '$set' : kwargs})
+        self._db.nodes.find_and_modify({'_id': nid}, kwargs)
 
     def removenodes(self, nid):
         nid = list(map(int, nid))