code: def delete_object(self, identifier, erase=False):
          
          # Get object to ensure that it exists.
          db_object = self.get_object(identifier)
          # Set active flag to False if object exists.
          if db_object is None:
              return None
          # Check whether the read-only property is set to true
          if PROPERTY_READONLY in db_object.properties:
              if db_object.properties[PROPERTY_READONLY]:
                  raise ValueError('cannot delete read-only resource')
          if erase:
              # Erase object from database
              self.collection.delete_many({"_id": identifier})
          else:
              # Delete object with given identifier by setting active flag
              # to False
              self.collection.update_one({"_id": identifier}, {'$set' : {'active' : False}})
          # Return retrieved object or None if it didn't exist.
          return db_object
docs: Delete the entry with given identifier in the database. Returns the
          handle for the deleted object or None if object identifier is unknown.
  
          If the read-only property of the object is set to true a ValueError is
          raised.
  
          Parameters
          ----------
          identifier : string
              Unique object identifier
          erase : Boolean, optinal
              If true, the record will be deleted from the database. Otherwise,
              the active flag will be set to False to support provenance tracking.
  
          Returns
          -------
          (Sub-class of)ObjectHandle