public class BasicUpdate extends Update
Update.AddToSetBuilder, Update.BitwiseOperatorBuilder, Update.Modifier, Update.Modifiers, Update.Position, Update.PushOperatorBuilderUpdateDefinition.ArrayFilter| Constructor and Description |
|---|
BasicUpdate(org.bson.Document updateObject) |
BasicUpdate(String updateString) |
| Modifier and Type | Method and Description |
|---|---|
Update |
addToSet(String key,
Object value)
Update using the $addToSet update modifier
|
org.bson.Document |
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
|
addFieldOperation, addMultiFieldOperation, addToSet, bitwise, currentDate, currentTimestamp, equals, filterArray, filterArray, fromDocument, getArrayFilters, hashCode, inc, isIsolated, isolated, max, min, modifies, multiply, push, setOnInsert, toString, updateclone, finalize, getClass, notify, notifyAll, wait, wait, waithasArrayFilterspublic BasicUpdate(String updateString)
public BasicUpdate(org.bson.Document updateObject)
public Update set(String key, @Nullable Object value)
Updateset in class Updatevalue - can be null. In this case the property remains in the db with a null value. To
remove it use Update.unset(String).public Update unset(String key)
Updateunset in class Updatepublic Update inc(String key, Number inc)
Updateinc in class Updatepublic Update push(String key, @Nullable Object value)
Updatepush in class Updatepublic Update pushAll(String key, Object[] values)
Update$pushAll update modifier. $pushAll has been deprecated in favor of $push $each.
Important: As of MongoDB 3.6 $pushAll is not longer supported. Use $push $each instead.
Update.push(String)) returns a builder that can be used to populate the $each object.pushAll in class Updatepublic Update addToSet(String key, @Nullable Object value)
UpdateaddToSet in class Updatepublic Update pop(String key, Update.Position pos)
Updatepop in class Updatepublic Update pull(String key, @Nullable Object value)
Updatepull in class Updatepublic Update pullAll(String key, Object[] values)
UpdatepullAll in class Updatepublic Update rename(String oldName, String newName)
Updaterename in class Updatepublic org.bson.Document getUpdateObject()
getUpdateObject in interface UpdateDefinitiongetUpdateObject in class UpdateDocument format. Never null.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.