def dropCollection(self): try: count = self.countItems() db.drop("mgmt_" + self.collection.lower()) return "collection of {} items dropped".format(count) except Exception as ex: return "Error dropping the database: {}".format(ex)
def dropCollection(self): try: count = self.countItems() db.drop("mgmt_" + self.collection.lower()) if self.args.v: print("collection of %s items dropped" % (count)) except Exception as ex: print("Error dropping the database: %s" % (ex)) sys.exit()
def dropCollection(self): try: count = self.countItems() db.drop("mgmt_"+self.collection.lower()) if self.args.v: print("collection of %s items dropped"%(count)) except Exception as ex: print("Error dropping the database: %s"%(ex)) sys.exit()
def dropCollection(self, user): try: #TODO it has to to be generic as much it can if user: function = self.removeAllFromListforUserFunction( collection=self.collection) logging.info( "User {0} starts removing of list with function {1}". format(user, function)) getattr(db, function)(user) else: count = self.countItems() # This is not I want to db.drop("mgmt_" + self.collection.lower()) if self.args.v: print("collection of %s items dropped" % (count)) except Exception as ex: print("Error dropping the database: %s" % (ex)) sys.exit()