public class Field extends Object
| Constructor and Description |
|---|
Field() |
| Modifier and Type | Method and Description |
|---|---|
Field |
elemMatch(String field,
Criteria elemMatchCriteria) |
boolean |
equals(Object o) |
Field |
exclude(String... fields)
Exclude one or more
fields from being returned by the query operation. |
Field |
exclude(String field)
Exclude a single
field from being returned by the query operation. |
org.bson.Document |
getFieldsObject() |
int |
hashCode() |
Field |
include(String... fields)
Include one or more
fields to be returned by the query operation. |
Field |
include(String field)
Include a single
field to be returned by the query operation. |
Field |
position(String field,
int value)
The array field must appear in the query.
|
Field |
slice(String field,
int size)
Project a
$slice of the array field using the first size elements. |
Field |
slice(String field,
int offset,
int size)
Project a
$slice of the array field using the first size elements starting at
offset. |
public Field include(String field)
field to be returned by the query operation.field - the document field name to be included.this field projection instance.public Field include(String... fields)
fields to be returned by the query operation.fields - the document field names to be included.this field projection instance.public Field exclude(String field)
field from being returned by the query operation.field - the document field name to be included.this field projection instance.public Field exclude(String... fields)
fields from being returned by the query operation.fields - the document field names to be included.this field projection instance.public Field slice(String field, int size)
$slice of the array field using the first size elements.field - the document field name to project, must be an array field.size - the number of elements to include.this field projection instance.public Field slice(String field, int offset, int size)
$slice of the array field using the first size elements starting at
offset.field - the document field name to project, must be an array field.offset - the offset to start at.size - the number of elements to include.this field projection instance.public Field position(String field, int value)
$ operator can appear in the projection and
only one array field can appear in the query.field - query array field, must not be null or empty.value - this field projection instance.public org.bson.Document getFieldsObject()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.