agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/search/MetadataSearch.java
/**
     * Find the {@link MetadataItem} matching the {@code userQuery} and the offset/limit specified
     *
     * @param userQuery {@link Bson} query to search collection for
     * @return list of {@link MetadataItem} matching the {@code userQuery} in the sort order specified
     * @throws MetadataStoreException if {@code userQuery} is unable to find matching {@link MetadataItem}
     *
     *
     */
Find the  MetadataItem matching the  userQuery and the offset/limit specified
@param userQuery  Bson query to search collection for
@return list of  MetadataItem matching the  userQuery in the sort order specified
@throws MetadataStoreException if  userQuery is unable to find matching  MetadataItem
Find the MetadataItem matching the userQuery and the offset / limit specified @param userQuery Bson query to search collection for @return list of MetadataItem matching the userQuery in the sort order specified @throws MetadataStoreException if userQuery is unable to find matching MetadataItem
public List<MetadataItem> find(Bson userQuery) throws MetadataStoreException {
        try {
            Bson permissionFilter = and(eq("tenantId", TenancyHelper.getCurrentTenantId()), userQuery);
            Document order = (orderField == null) ? new Document() : new Document(orderField, orderDirection);
            getMetadataDao().setAccessibleOwners(this.accessibleOwners);
            return getMetadataDao().find(this.username, permissionFilter, offset, limit, order);
        } catch (Exception e) {
            throw new MetadataStoreException("Unable to find resource based on query.");
        }
    }
public List < MetadataItem > find ( Bson userQuery ) throws MetadataStoreException { try { Bson permissionFilter = and ( eq ( "tenantId" , TenancyHelper . getCurrentTenantId ( ) ) , userQuery ) ; Document order = ( orderField == null ) ? new Document ( ) : new Document ( orderField , orderDirection ) ; getMetadataDao ( ) . setAccessibleOwners ( this . accessibleOwners ) ; return getMetadataDao ( ) . find ( this . username , permissionFilter , offset , limit , order ) ; } catch ( Exception e ) { throw new MetadataStoreException ( "Unable to find resource based on query." ) ; } }
Find the {@link MetadataItem} matching the {@code userQuery} and the offset/limit specified
 @param userQuery {@link Bson} query to search collection for
 @return list of {@link MetadataItem} matching the {@code userQuery} in the sort order specified
 @throws MetadataStoreException if {@code userQuery} is unable to find matching {@link MetadataItem}
Find the { @link MetadataItem } matching the { @code userQuery } and the offset / limit specified @param userQuery { @link Bson } query to search collection for @return list of { @link MetadataItem } matching the { @code userQuery } in the sort order specified @throws MetadataStoreException if { @code userQuery } is unable to find matching { @link MetadataItem }