Browse Source

Replaced update_many by update and return res['n']

prieto 8 years ago
parent
commit
e7163894a6
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      plugins/mongodb_datasource/datasource.py

+ 4
- 3
plugins/mongodb_datasource/datasource.py View File

215
         mongo_filters = self.__process_filters(
215
         mongo_filters = self.__process_filters(
216
             target, filters, relational_filters)
216
             target, filters, relational_filters)
217
         res = self.__collection(target).update(mongo_filters, upd_datas)
217
         res = self.__collection(target).update(mongo_filters, upd_datas)
218
-        
219
-        return 1 #res.modified_count()
218
+        logger.warning(mongo_filters)
219
+        logger.warning(upd_datas)
220
+        logger.warning(res)
221
+        return res['n']
220
 
222
 
221
     ## @brief Inserts a record in a given collection
223
     ## @brief Inserts a record in a given collection
222
     # @param target Emclass : class of the object to insert
224
     # @param target Emclass : class of the object to insert
223
     # @param new_datas dict : datas to insert
225
     # @param new_datas dict : datas to insert
224
     # @return the inserted uid
226
     # @return the inserted uid
225
     def insert(self, target, new_datas):
227
     def insert(self, target, new_datas):
226
-        new_datas['lodel_id'] = self.new_numeric_id(target)
227
         res = self.__collection(target).insert(new_datas)
228
         res = self.__collection(target).insert(new_datas)
228
         return str(res)
229
         return str(res)
229
 
230
 

Loading…
Cancel
Save