agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/dao/MetadataDao.java
/**
     * Find all {@link MetadataItem} from the mongo collection based on the {@link Bson} query as the {@code user}
     *
     * @param user   making the query
     * @param query  {@link Bson} query to search with
     * @param offset int offset
     * @return metadataItem
     */
Find all  MetadataItem from the mongo collection based on the  Bson query as the  user
@param user   making the query
@param query   Bson query to search with
@param offset int offset
@return metadataItem
Find all MetadataItem from the mongo collection based on the Bson query as the user @param user making the query @param query Bson query to search with @param offset int offset @return metadataItem
public List<MetadataItem> find(String user, Bson query, int offset, int limit, Document order) {
        MongoCursor cursor;
        List<MetadataItem> resultList = new ArrayList<>();
        MongoCollection<MetadataItem> metadataItemMongoCollection;
        metadataItemMongoCollection = getDefaultMetadataItemCollection();
        if (query == null) {
            query = new Document();
        }
        if (accessibleOwners == null) {
            accessibleOwners = new ArrayList<>();
        }
        Bson withPermissionQuery = and(query, getHasReadQuery(user, accessibleOwners));
        try {
            cursor = metadataItemMongoCollection.find(withPermissionQuery)
                    .sort(order)
                    .skip(offset)
                    .batchSize(-Settings.MAX_PAGE_SIZE)
                    .limit(limit).cursor();
            while (cursor.hasNext()) {
                MetadataItem metadataItem = (MetadataItem) cursor.next();
                resultList.add(metadataItem);
            }
        } catch (Exception e) {
        }
        return resultList;
    }
public List < MetadataItem > find ( String user , Bson query , int offset , int limit , Document order ) { MongoCursor cursor ; List < MetadataItem > resultList = new ArrayList < > ( ) ; MongoCollection < MetadataItem > metadataItemMongoCollection ; metadataItemMongoCollection = getDefaultMetadataItemCollection ( ) ; if ( query == null ) { query = new Document ( ) ; } if ( accessibleOwners == null ) { accessibleOwners = new ArrayList < > ( ) ; } Bson withPermissionQuery = and ( query , getHasReadQuery ( user , accessibleOwners ) ) ; try { cursor = metadataItemMongoCollection . find ( withPermissionQuery ) . sort ( order ) . skip ( offset ) . batchSize ( - Settings . MAX_PAGE_SIZE ) . limit ( limit ) . cursor ( ) ; while ( cursor . hasNext ( ) ) { MetadataItem metadataItem = ( MetadataItem ) cursor . next ( ) ; resultList . add ( metadataItem ) ; } } catch ( Exception e ) { } return resultList ; }
Find all {@link MetadataItem} from the mongo collection based on the {@link Bson} query as the {@code user}
 @param user   making the query
 @param query  {@link Bson} query to search with
 @param offset int offset
 @return metadataItem
Find all { @link MetadataItem } from the mongo collection based on the { @link Bson } query as the { @code user } @param user making the query @param query { @link Bson } query to search with @param offset int offset @return metadataItem
//POGO //negative batch size limits response docs, positive sets size limit of each batch