split
open fun <Context : Any> Value<Context, String>.split(delimiter: Value<Context, String>): Value<Context, List<String>?>(source)
open fun <Context : Any> Value<Context, String>.split(delimiter: Field<Context, String>): Value<Context, List<String>?>(source)
open fun <Context : Any> Value<Context, String>.split(delimiter: KProperty1<Context, String>): Value<Context, List<String>?>(source)
inline fun <Context : Any> Value<Context, String>.split(delimiter: String): Value<Context, List<String>?>(source)
open fun <Context : Any> Field<Context, String>.split(delimiter: Value<Context, String>): Value<Context, List<String>?>(source)
open fun <Context : Any> Field<Context, String>.split(delimiter: Field<Context, String>): Value<Context, List<String>?>(source)
open fun <Context : Any> Field<Context, String>.split(delimiter: KProperty1<Context, String>): Value<Context, List<String>?>(source)
inline fun <Context : Any> Field<Context, String>.split(delimiter: String): Value<Context, List<String>?>(source)
open fun <Context : Any> KProperty1<Context, String>.split(delimiter: Value<Context, String>): Value<Context, List<String>?>(source)
open fun <Context : Any> KProperty1<Context, String>.split(delimiter: Field<Context, String>): Value<Context, List<String>?>(source)
open fun <Context : Any> KProperty1<Context, String>.split(delimiter: KProperty1<Context, String>): Value<Context, List<String>?>(source)
inline fun <Context : Any> KProperty1<Context, String>.split(delimiter: String): Value<Context, List<String>?>(source)
inline fun <Context : Any> String.split(delimiter: Value<Context, String>): Value<Context, List<String>?>(source)
inline fun <Context : Any> String.split(delimiter: Field<Context, String>): Value<Context, List<String>?>(source)
inline fun <Context : Any> String.split(delimiter: KProperty1<Context, String>): Value<Context, List<String>?>(source)
Divides a string into an array of substrings based on a delimiter.
$split removes the delimiter and returns the resulting substrings as elements of an array. If the delimiter is not found in the string, $split returns the original string as the only element of an array.
Both the string expression and delimiter must be strings. Otherwise, the operation fails with an error.
Example
class Document(
val city: String,
val cityState: List<String>,
)
collection.aggregate()
.set {
Document::cityState set of(Document::city).split(of(", "))
}.toList()Content copied to clipboard