mutableDocOf

fun mutableDocOf(id: String?, vararg pairs: Pair<String, Any?>): MutableDocument

Creates a new Document with a given ID and content from the passed key/value pairs. If the id is null, the document will be created with a new random UUID. Allowed value types are List, Instant, Map, Number, null, String, Array, Blob, and Dictionary. The List and Map must contain only the above types. The created document will be saved into a database when you call the Database's save(Document) method with the document object given.

Parameters

id

the document ID

pairs

the content key/value pairs


fun mutableDocOf(vararg pairs: Pair<String, Any?>): MutableDocument

Creates a new Document with a new random UUID and the key/value pairs as the content. Allowed value types are List, Instant, Map, Number, null, String, Array, Blob, and Dictionary. If present, Lists, Arrays, Maps and Dictionaries may contain only the above types. The created document will be saved into a database when you call Database.save(Document) with this document object.

Parameters

pairs

the content key/value pairs