Example usage for org.springframework.data.mongodb.core.query Field exclude

List of usage examples for org.springframework.data.mongodb.core.query Field exclude

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core.query Field exclude.

Prototype

public Field exclude(String key) 

Source Link

Usage

From source file:piecework.repository.concrete.ProcessInstanceRepositoryCustomImpl.java

@Override
public Page<ProcessInstance> findByQueryParameters(Set<String> processDefinitionKeys,
        SearchQueryParameters queryParameters, Pageable pageable, Sanitizer sanitizer) {
    // Otherwise, look up all instances that match the query
    Query query = SearchUtility.query(queryParameters, processDefinitionKeys, sanitizer);
    query.skip(pageable.getOffset());/*w  w  w  . j a v a 2s . c om*/
    query.limit(pageable.getPageSize());

    org.springframework.data.mongodb.core.query.Field field = query.fields();

    // Don't include form data in the result unless it's requested
    //        if (! criteria.isIncludeVariables())
    field.exclude("data");

    return findByQuery(query, pageable, true);
}