Class MongoDBConverter.UpdateBuilder
java.lang.Object
org.nuxeo.ecm.core.storage.mongodb.MongoDBConverter.UpdateBuilder
- Enclosing class:
- MongoDBConverter
Update list builder to prevent several updates of the same field.
This happens if two operations act on two fields where one is a prefix of the other.
Example: Cannot update 'mylist.0.string' and 'mylist' at the same time (error 16837)
- Since:
- 5.9.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MongoDBConverter.ConditionsAndUpdatesprotected final org.bson.Documentprotected final org.bson.Documentprotected final org.bson.Documentprotected final org.bson.Documentprotected final org.bson.Documentprotected org.bson.Document -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(State.StateDiff diff) protected voidcheckForConflict(String key) Checks if the key conflicts with one of the previous keys.protected booleanconflictKeys(String key, List<String> subkeys) getPrefixKeys(String key) return a list of parents keyprotected voidprotected voidprocessDelta(Delta delta, String prefix) protected voidprocessListDiff(State.ListDiff listDiff, String prefix) protected voidprocessStateDiff(State.StateDiff diff, String prefix) protected voidprocessValue(String name, Serializable value) protected void
-
Field Details
-
set
protected final org.bson.Document set -
unset
protected final org.bson.Document unset -
push
protected final org.bson.Document push -
pull
protected final org.bson.Document pull -
inc
protected final org.bson.Document inc -
conditionsAndUpdates
-
update
protected org.bson.Document update -
prefixKeys
-
keys
-
-
Constructor Details
-
UpdateBuilder
public UpdateBuilder()
-
-
Method Details
-
build
-
processStateDiff
-
processListDiff
-
processDelta
-
processValue
-
newUpdate
protected void newUpdate() -
update
-
checkForConflict
Checks if the key conflicts with one of the previous keys.A conflict occurs if one key is equals to or is a prefix of the other.
-
conflictKeys
-
getPrefixKeys
return a list of parents keyfoo.0.bar -> [foo, foo.0, foo.0.bar]
-