InsertSource

class InsertSource @ExperimentalDelvaApi constructor(val source: InputStream, val types: Map<String, String> = emptyMap(), replaces: Collection<DocId>, onExistingKey: KeyConflict = KeyConflict.FAIL)(source)

One document for JsonStore.insertAll: the stream its JSON is read from, which isn't closed, the types to assign with it, JSON paths to type names as JsonStore.insert takes them, the documents it replaces, and in a store with a CreationOptions.documentKey what it does when its key is taken (onExistingKey).

Constructors

Link copied to clipboard
constructor(source: InputStream, types: Map<String, String> = emptyMap(), replaces: Collection<DocId>, onExistingKey: KeyConflict = KeyConflict.FAIL)
constructor(source: InputStream, types: Map<String, String> = emptyMap())

A plain insert: the source replaces nothing, and a key that is taken fails it.

Properties

Link copied to clipboard

In a store with a CreationOptions.documentKey, what happens when a visible document that replaces doesn't name already has this document's key: KeyConflict.FAIL makes the outcome InsertOutcome.Conflicted, KeyConflict.REPLACE replaces that document too, as JsonStore.upsert does. Ignored in a store without keys.

Link copied to clipboard

The documents deleted in the same atomic change as this insert, each once, as JsonStore.replace deletes them; empty for a plain insert.

Link copied to clipboard

The stream the document's JSON is read from; it isn't closed.

Link copied to clipboard

The types to assign with the document: JSON paths to type names, as JsonStore.insert takes them.

Functions

Link copied to clipboard
open override fun toString(): String