Search in sources :

Example 1 with UpdateOperator

use of dev.morphia.query.experimental.updates.UpdateOperator in project morphia by mongodb.

the class UpdateBase method toDocument.

/**
 * @return the operations listed
 */
public Document toDocument() {
    final Operations operations = new Operations(datastore, mapper.getEntityModel(type));
    for (UpdateOperator update : updates) {
        PathTarget pathTarget = new PathTarget(mapper, mapper.getEntityModel(type), update.field(), true);
        operations.add(update.operator(), update.toTarget(pathTarget));
    }
    return operations.toDocument();
}
Also used : UpdateOperator(dev.morphia.query.experimental.updates.UpdateOperator) PathTarget(dev.morphia.internal.PathTarget)

Aggregations

PathTarget (dev.morphia.internal.PathTarget)1 UpdateOperator (dev.morphia.query.experimental.updates.UpdateOperator)1