MutateInSpec

class MutateInSpec

Functions

Link copied to clipboard
fun addAndGet(path: String, delta: Long, xattr: Boolean = false): SubdocLong

Adds delta to an integral number field. If the field does not exist, creates it with a value of delta.

Link copied to clipboard
fun arrayAddUnique(path: String, value: Boolean?, xattr: Boolean = false)
fun arrayAddUnique(path: String, value: Int?, xattr: Boolean = false)
fun arrayAddUnique(path: String, value: Long?, xattr: Boolean = false)
fun arrayAddUnique(path: String, value: String?, xattr: Boolean = false)

Adds the value to an array (creating the array if it doesn't already exist) or fail with PathExistsException if the array already contains the value.

Link copied to clipboard
inline fun <T> arrayAppend(path: String, values: List<T>, xattr: Boolean = false)
Link copied to clipboard
inline fun <T> arrayInsert(path: String, values: List<T>, xattr: Boolean = false)
Link copied to clipboard
inline fun <T> arrayPrepend(path: String, values: List<T>, xattr: Boolean = false)
Link copied to clipboard
fun decrementAndGet(path: String, xattr: Boolean = false): SubdocLong

Convenience method equivalent to addAndGet with a delta of -1.

fun decrementAndGet(path: String, delta: Long = 1, xattr: Boolean = false): SubdocLong
Link copied to clipboard
fun incrementAndGet(path: String, xattr: Boolean = false): SubdocLong

Convenience method equivalent to addAndGet with a delta of 1.

fun incrementAndGet(path: String, delta: Long = 1, xattr: Boolean = false): SubdocLong
Link copied to clipboard
inline fun <T> insert(path: String, value: T, xattr: Boolean = false)

Inserts an Object node field. Fails if the field already exists.

Link copied to clipboard
fun remove(path: String, xattr: Boolean = false)

Removes the targeted element (or whole doc if path is empty)

Link copied to clipboard
inline fun <T> replace(path: String, value: T, xattr: Boolean = false)

Replaces an Object node field or Array element.

Link copied to clipboard
inline fun <T> upsert(path: String, value: T, xattr: Boolean = false)

Upserts an Object node field.