Explorar el Código

Find_and_modify is more suited for edits

oz123 hace 10 años
padre
commit
5d1f4571ab
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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))