Class Update

java.lang.Object
com.datastax.astra.client.model.Document
com.datastax.astra.client.model.Update
All Implemented Interfaces:
Serializable, Map<String,Object>

public class Update extends Document
Encore the update document
See Also:
  • Constructor Details

    • Update

      public Update()
      Default constructor.
    • Update

      public Update(String json)
      Default constructor.
      Parameters:
      json - filter expression as JSON
    • Update

      public Update(Map<String,Object> obj)
      Default constructor.
      Parameters:
      obj - filter expression as JSON
  • Method Details

    • create

      public static Update create()
      Allow to creat a new instance.
      Returns:
      a new instance
    • inc

      public Update inc(String key, Double offset)
      Builder pattern
      Parameters:
      key - field name
      offset - increment value
      Returns:
      reference to self
    • unset

      public Update unset(String fieldName)
      Builder pattern
      Parameters:
      fieldName - field name
      Returns:
      reference to self
    • set

      public Update set(String key, Object value)
      Builder pattern
      Parameters:
      key - field name
      value - filed value
      Returns:
      reference to self
    • set

      public Update set(Document fields)
      Builder pattern
      Parameters:
      fields - ` fields map
      Returns:
      reference to self
    • min

      public Update min(String key, Object value)
      Builder pattern
      Parameters:
      key - field name
      value - filed value
      Returns:
      reference to self
    • push

      public Update push(String key, Object value)
      Builder pattern
      Parameters:
      key - field name
      value - filed value
      Returns:
      reference to self
    • pop

      public Update pop(String key, Object value)
      Builder pattern
      Parameters:
      key - field name
      value - filed value
      Returns:
      reference to self
    • pushEach

      public Update pushEach(String key, List<Object> values, Integer position)
      Builder pattern.
      Parameters:
      key - field name
      values - filed list values
      position - where to push in the list
      Returns:
      reference to self
    • addToSet

      public Update addToSet(String key, Object value)
      Builder pattern
      Parameters:
      key - field name
      value - filed value
      Returns:
      reference to self
    • rename

      public Update rename(String key, Object value)
      Builder pattern
      Parameters:
      key - field name
      value - filed value
      Returns:
      reference to self
    • updateCurrentDate

      public Update updateCurrentDate(String... fields)
      Builder pattern
      Parameters:
      fields - fields to rename
      Returns:
      reference to self
    • updateMul

      public Update updateMul(Map<String,Double> fields)
      Builder pattern
      Parameters:
      fields - fields to rename
      Returns:
      reference to self
    • updateSetOnInsert

      public Update updateSetOnInsert(Map<String,Double> fields)
      Builder pattern
      Parameters:
      fields - fields to rename
      Returns:
      reference to self