agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/search/MetadataSearch.java
/**
     * Update collection using {@link Document} doc, merges with the existing item
     *
     * @param updatedDocumentFields {@link Document} to update Metadata Item with
     * @return updated {@link Document}
     * @throws MetadataException if no {@link Document} found matching the document
     *                           based on the uuid and tenantId
     */
Update collection using  Document doc, merges with the existing item
@param updatedDocumentFields  Document to update Metadata Item with
@return updated  Document
@throws MetadataException if no  Document found matching the document
based on the uuid and tenantId
Update collection using Document doc merges with the existing item @param updatedDocumentFields Document to update Metadata Item with @return updated Document @throws MetadataException if no Document found matching the document based on the uuid and tenantId
public Document updateMetadataItem(Document updatedDocumentFields, String uuid) throws MetadataException {
        if (updatedDocumentFields == null) {
            updatedDocumentFields = new Document();
        }
        updatedDocumentFields.putAll(Map.of(
                "uuid", uuid,
                "tenantId", TenancyHelper.getCurrentTenantId(),
                "lastUpdated", new Date()));
        updatedDocumentFields.remove("created");
        updatedDocumentFields.remove("lastUpdated");
        updatedDocumentFields.remove("owner");
        updatedDocumentFields.remove("internalUsername");
        getMetadataDao().setAccessibleOwners(this.accessibleOwners);
        return getMetadataDao().updateDocument(updatedDocumentFields);
    }
public Document updateMetadataItem ( Document updatedDocumentFields , String uuid ) throws MetadataException { if ( updatedDocumentFields == null ) { updatedDocumentFields = new Document ( ) ; } updatedDocumentFields . putAll ( Map . of ( "uuid" , uuid , "tenantId" , TenancyHelper . getCurrentTenantId ( ) , "lastUpdated" , new Date ( ) ) ) ; updatedDocumentFields . remove ( "created" ) ; updatedDocumentFields . remove ( "lastUpdated" ) ; updatedDocumentFields . remove ( "owner" ) ; updatedDocumentFields . remove ( "internalUsername" ) ; getMetadataDao ( ) . setAccessibleOwners ( this . accessibleOwners ) ; return getMetadataDao ( ) . updateDocument ( updatedDocumentFields ) ; }
Update collection using {@link Document} doc, merges with the existing item
 @param updatedDocumentFields {@link Document} to update Metadata Item with
 @return updated {@link Document}
 @throws MetadataException if no {@link Document} found matching the document
                           based on the uuid and tenantId
Update collection using { @link Document } doc merges with the existing item @param updatedDocumentFields { @link Document } to update Metadata Item with @return updated { @link Document } @throws MetadataException if no { @link Document } found matching the document based on the uuid and tenantId
// ensure immutable fields cannot be updated //        if (getMetadataDao().hasWrite(this.username, getMetadataItem().getUuid())) { //            doc.append("uuid", uuid); //            doc.append("tenantId", TenancyHelper.getCurrentTenantId()); //            return getMetadataDao().updateDocument(doc); //        } else { //            throw new PermissionException("User does not have permission to modify this resource."); //        }