public class Update extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Update.Position |
Constructor and Description |
---|
Update() |
Modifier and Type | Method and Description |
---|---|
protected void |
addMultiFieldOperation(String operator,
String key,
Object value) |
Update |
addToSet(String key,
Object value)
Update using the $addToSet update modifier
|
static Update |
fromDBObject(DBObject object,
String... exclude)
|
DBObject |
getUpdateObject() |
Update |
inc(String key,
Number inc)
Update using the $inc update modifier
|
Update |
pop(String key,
Update.Position pos)
Update using the $pop update modifier
|
Update |
pull(String key,
Object value)
Update using the $pull update modifier
|
Update |
pullAll(String key,
Object[] values)
Update using the $pullAll update modifier
|
Update |
push(String key,
Object value)
Update using the $push update modifier
|
Update |
pushAll(String key,
Object[] values)
Update using the $pushAll update modifier
|
Update |
rename(String oldName,
String newName)
Update using the $rename update modifier
|
Update |
set(String key,
Object value)
Update using the $set update modifier
|
Update |
unset(String key)
Update using the $unset update modifier
|
static Update |
update(String key,
Object value)
Static factory method to create an Update using the provided key
|
public static Update update(String key, Object value)
key
- public static Update fromDBObject(DBObject object, String... exclude)
Update
instance from the given DBObject
. Allows to explicitly exlude fields from making
it into the created Update
object.object
- the source DBObject
to create the update from.exclude
- the fields to exclude.public Update set(String key, Object value)
key
- value
- public Update unset(String key)
key
- public Update inc(String key, Number inc)
key
- inc
- public Update push(String key, Object value)
key
- value
- public Update pushAll(String key, Object[] values)
key
- values
- public Update addToSet(String key, Object value)
key
- value
- public Update pop(String key, Update.Position pos)
key
- pos
- public Update pull(String key, Object value)
key
- value
- public Update pullAll(String key, Object[] values)
key
- values
- public Update rename(String oldName, String newName)
oldName
- newName
- public DBObject getUpdateObject()
Copyright © 2012. All Rights Reserved.