agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/dao/MetadataDao.java
/**
     * Find the {@link MetadataItem} from the mongo collection based on the {@link Bson query} filtered
     * by {@code filter}
     *
     * @param query  {@link Bson} query to search with
     * @param filter list of String to specify which fields to return
     * @return List of {@link Document} matching the query criteria
     */
Find the  MetadataItem from the mongo collection based on the  Bson query filtered
by  filter

@param query   Bson query to search with
@param filter list of String to specify which fields to return
@return List of  Document matching the query criteria
Find the MetadataItem from the mongo collection based on the Bson query filtered by filter @param query Bson query to search with @param filter list of String to specify which fields to return @return List of Document matching the query criteria
public List<Document> filterFind(Bson query, Bson filter, int offset, int limit, Document order) {
        MongoCursor cursor;
        List<Document> resultList = new ArrayList<>();
        MongoCollection mongoCollection = getDefaultCollection();
        if (query == null) {
            query = new Document();
        }
        try {
            cursor = mongoCollection.find(query)
                    .sort(order)
                    .skip(offset)
                    .batchSize(-Settings.MAX_PAGE_SIZE)
                    .limit(limit)
                    .projection(filter).cursor();
            while (cursor.hasNext()) {
                Document foundDocuments = (Document) cursor.next();
                resultList.add(foundDocuments);
            }
        } catch (Exception ignored) {}
        return resultList;
    }
public List < Document > filterFind ( Bson query , Bson filter , int offset , int limit , Document order ) { MongoCursor cursor ; List < Document > resultList = new ArrayList < > ( ) ; MongoCollection mongoCollection = getDefaultCollection ( ) ; if ( query == null ) { query = new Document ( ) ; } try { cursor = mongoCollection . find ( query ) . sort ( order ) . skip ( offset ) . batchSize ( - Settings . MAX_PAGE_SIZE ) . limit ( limit ) . projection ( filter ) . cursor ( ) ; while ( cursor . hasNext ( ) ) { Document foundDocuments = ( Document ) cursor . next ( ) ; resultList . add ( foundDocuments ) ; } } catch ( Exception ignored ) { } return resultList ; }
Find the {@link MetadataItem} from the mongo collection based on the {@link Bson query} filtered
 by {@code filter}
Find the { @link MetadataItem } from the mongo collection based on the { @link Bson query } filtered by { @code filter }
//Don't use custom codecs for faster processing with filters/projections