Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Update Builder

Otávio Santana edited this page Feb 14, 2014 · 9 revisions

The class Update Builder is a really simple way to update some columns with options:

Options

  • withConsistencyLevel: Sets the consistency level for the query
  • withTimeStamp: Option to set the timestamp for a modification query.
  • withTtl: Option to set the ttl for a modification query.

set value

  • value: Simple "set" assignment of a value to a column. This will generate: name = value.

counter

  • incr: Incrementation of a counter column.
  • incr: Incrementation of a counter column by a provided value.
  • derc: decrementation of a counter column.
  • derc: Decrementation of a counter column by a provided value.

Set

  • addSet: Adds a value to a set column. This will generate: name = name + {value}}.
  • addSetAll: Adds a set of values to a set column. This will generate: name = name + set.
  • removeSet: Remove a value from a set column. This will generate: name = name - {value}}. preAddList: Prepend a value to a list column.
  • removeSetAll: Remove a set of values from a set column. This will generate: name = name - set.

List

  • addList: Append a value to a list column.
  • addListAll: Append a list of values to a list column.
  • addIndexList: Sets a list column value by index.
  • preAddListAll: Prepend a list of values to a list column.
  • removeList: Discard a value from a list column.
  • removeListAll: Discard a list of values to a list column.

Map

  • put: Puts a new key/value pair to a map column.
  • put: Puts a map of new key/value pairs to a map column.

Where

  • whereEq: reates an "equal" where clause.
  • whereIn: Create an "in" where clause stating the provided column must be equal

Run

  • execute: execute the query.
  • executeAsync: update the provided query asynchronously.
  • executeAsync(asyncCallBack): execute the process asynchronous with asyncCallBack.

Examples

To know more: Update Builder

Clone this wiki locally