Example usage for com.amazonaws.services.dynamodbv2.xspec ExpressionSpecBuilder remove

List of usage examples for com.amazonaws.services.dynamodbv2.xspec ExpressionSpecBuilder remove

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.xspec ExpressionSpecBuilder remove.

Prototype

public static RemoveAction remove(String path) 

Source Link

Document

Returns a RemoveAction for removing the attribute with the specified path from an item; used for building update expression.

Usage

From source file:com.github.fge.jsonpatch.MoveOperation.java

License:LGPL

@Override
public void applyToBuilder(ExpressionSpecBuilder builder) {
    String removePath = pathGenerator.apply(from);
    String setPath = pathGenerator.apply(path);
    //remove the attribute in the from location
    builder.addUpdate(ExpressionSpecBuilder.remove(removePath));
    //set the attribute in the path location
    builder.addUpdate(new PathSetAction(ExpressionSpecBuilder.attribute(setPath),
            ExpressionSpecBuilder.attribute(removePath)));
}

From source file:com.github.fge.jsonpatch.RemoveOperation.java

License:LGPL

@Override
public void applyToBuilder(ExpressionSpecBuilder builder) {
    String attributePath = pathGenerator.apply(path);
    builder.addUpdate(ExpressionSpecBuilder.remove(attributePath));
    //because it is an error to remove a path that does not exist
    //add an attribute_exists() condition
    builder.withCondition(ExpressionSpecBuilder.attribute_exists(pathGenerator.apply(path)));
}