|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mongodb.core.query.Update
public class Update
Class to easily construct MongoDB update clauses.
| Nested Class Summary | |
|---|---|
static class |
Update.Position
|
| Constructor Summary | |
|---|---|
Update()
|
|
| Method Summary | |
|---|---|
protected void |
addMultiFieldOperation(String operator,
String key,
Object value)
|
Update |
addToSet(String key,
Object value)
Update using the $addToSet update modifier |
static Update |
fromDBObject(com.mongodb.DBObject object,
String... exclude)
Creates an Update instance from the given DBObject. |
com.mongodb.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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Update()
| Method Detail |
|---|
public static Update update(String key,
Object value)
key -
public static Update fromDBObject(com.mongodb.DBObject object,
String... exclude)
Update instance from the given DBObject. Allows to explicitly exlude fields from making
it into the created Update object. Note, that this will set attributes directly and not use
$set. This means fields not given in the DBObject will be nulled when executing the update. To
create an only-updating Update instance of a DBObject, call set(String, Object) for each
value in it.
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 com.mongodb.DBObject getUpdateObject()
protected void addMultiFieldOperation(String operator,
String key,
Object value)
|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||