public class FindAndModify extends Object
MongoCollection.findAndModify(com.allanbank.mongodb.builder.FindAndModify)
command. Objects of this class are created using the nested FindAndModify.Builder
.Modifier and Type | Class and Description |
---|---|
static class |
FindAndModify.Builder
Helper for creating immutable
FindAndModify commands. |
Modifier and Type | Field and Description |
---|---|
static Document |
ALL
An (empty) query document to find all documents.
|
static Version |
MAX_TIMEOUT_VERSION
The first version of MongoDB to support the
findAndModify command
with the ability to limit the execution time on the server. |
static Document |
NONE
An (empty) update document to perform no actual modifications.
|
Modifier | Constructor and Description |
---|---|
protected |
FindAndModify(FindAndModify.Builder builder)
Create a new FindAndModify.
|
Modifier and Type | Method and Description |
---|---|
static FindAndModify.Builder |
builder()
Creates a new builder for a
FindAndModify . |
Document |
getFields()
Returns the subset of fields to retrieve from the matched document.
|
long |
getMaximumTimeMilliseconds()
Returns the maximum amount of time to allow the command to run on the
Server before it is aborted.
|
Document |
getQuery()
Returns the query to locate the document to update.
|
Document |
getSort()
Returns the sort to apply if multiple docs match, choose the first one as
the object to manipulate.
|
Document |
getUpdate()
Returns the updates to be applied to the document.
|
boolean |
isRemove()
Returns true if the document should be removed.
|
boolean |
isReturnNew()
Returns true if the updated document should be returned instead of the
document before the update.
|
boolean |
isUpsert()
Returns true to create the document if it doesn't exist.
|
public static final Document ALL
public static final Version MAX_TIMEOUT_VERSION
findAndModify
command
with the ability to limit the execution time on the server.public static final Document NONE
protected FindAndModify(FindAndModify.Builder builder)
builder
- The builder to copy from.public static FindAndModify.Builder builder()
FindAndModify
.FindAndModify
.public Document getFields()
public long getMaximumTimeMilliseconds()
public Document getQuery()
public Document getSort()
public Document getUpdate()
public boolean isRemove()
public boolean isReturnNew()
public boolean isUpsert()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.