public class MongoDBConverter.UpdateBuilder extends Object
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)
Modifier and Type | Field and Description |
---|---|
protected org.bson.Document |
inc |
protected Set<String> |
keys |
protected Set<String> |
prefixKeys |
protected org.bson.Document |
push |
protected org.bson.Document |
set |
protected org.bson.Document |
unset |
protected org.bson.Document |
update |
protected List<org.bson.Document> |
updates |
Constructor and Description |
---|
UpdateBuilder() |
Modifier and Type | Method and Description |
---|---|
List<org.bson.Document> |
build(State.StateDiff diff) |
protected void |
checkForConflict(String key)
Checks if the key conflicts with one of the previous keys.
|
protected boolean |
conflictKeys(String key,
List<String> subkeys) |
protected List<String> |
getPrefixKeys(String key)
return a list of parents key
foo.0.bar -> [foo, foo.0, foo.0.bar]
|
protected void |
newUpdate() |
protected void |
processDelta(Delta delta,
String prefix) |
protected void |
processListDiff(State.ListDiff listDiff,
String prefix) |
protected void |
processStateDiff(State.StateDiff diff,
String prefix) |
protected void |
processValue(String name,
Serializable value) |
protected void |
update(String op,
String key,
Object value) |
protected final org.bson.Document set
protected final org.bson.Document unset
protected final org.bson.Document push
protected final org.bson.Document inc
protected org.bson.Document update
protected Set<String> prefixKeys
public UpdateBuilder()
public List<org.bson.Document> build(State.StateDiff diff)
protected void processStateDiff(State.StateDiff diff, String prefix)
protected void processListDiff(State.ListDiff listDiff, String prefix)
protected void processDelta(Delta delta, String prefix)
protected void processValue(String name, Serializable value)
protected void newUpdate()
protected void checkForConflict(String key)
A conflict occurs if one key is equals to or is a prefix of the other.
protected boolean conflictKeys(String key, List<String> subkeys)
protected List<String> getPrefixKeys(String key)
Copyright © 2018 Nuxeo. All rights reserved.