MutateInSpec.decrement constructor

MutateInSpec.decrement(
  1. String path,
  2. int delta, {
  3. bool? createPath,
  4. bool? xattr,
})

Creates a MutateInSpec for decrementing the value of a field in a document.

When createPath is true, the path to the field will be created if it does not already exist. Defaults to false.

When xattr is true, this operation references the extended attribute data of the document. Otherwise, it references the document body. Defaults to false.

Implementation

factory MutateInSpec.decrement(
  String path,
  int delta, {
  bool? createPath,
  bool? xattr,
}) {
  return MutateInSpec._create(
    Opcode.counter,
    path,
    -delta,
    createPath: createPath,
    xattr: xattr,
  );
}