agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/dao/MetadataDao.java
/**
     * Delete {@code metadataItem} from the collection as the specified user
     *
     * @param metadataItem {@link MetadataItem} to delete
     * @return the deleted {@link MetadataItem}
     */
Delete  metadataItem from the collection as the specified user
@param metadataItem  MetadataItem to delete
@return the deleted  MetadataItem
Delete metadataItem from the collection as the specified user @param metadataItem MetadataItem to delete @return the deleted MetadataItem
public MetadataItem deleteMetadata(MetadataItem metadataItem) throws MetadataException {
        MongoCollection<MetadataItem> metadataItemMongoCollection;
        metadataItemMongoCollection = getDefaultMetadataItemCollection();
        if (metadataItem == null)
            throw new MetadataException("Unable to delete null MetadataItem.");
        DeleteResult deleteResult = metadataItemMongoCollection.deleteOne(
                getUuidAndTenantIdQuery(metadataItem.getUuid(), metadataItem.getTenantId()));
        if (deleteResult.getDeletedCount() == 0) {
            return null;
        }
        return metadataItem;
    }
public MetadataItem deleteMetadata ( MetadataItem metadataItem ) throws MetadataException { MongoCollection < MetadataItem > metadataItemMongoCollection ; metadataItemMongoCollection = getDefaultMetadataItemCollection ( ) ; if ( metadataItem == null ) throw new MetadataException ( "Unable to delete null MetadataItem." ) ; DeleteResult deleteResult = metadataItemMongoCollection . deleteOne ( getUuidAndTenantIdQuery ( metadataItem . getUuid ( ) , metadataItem . getTenantId ( ) ) ) ; if ( deleteResult . getDeletedCount ( ) == 0 ) { return null ; } return metadataItem ; }
Delete {@code metadataItem} from the collection as the specified user
 @param metadataItem {@link MetadataItem} to delete
 @return the deleted {@link MetadataItem}
Delete { @code metadataItem } from the collection as the specified user @param metadataItem { @link MetadataItem } to delete @return the deleted { @link MetadataItem }
//delete unsuccessful