unwind

fun unwind(fieldName: String, unwindOptions: UnwindOptions = UnwindOptions()): Bson
fun <T> KProperty<T>.unwind(unwindOptions: UnwindOptions = UnwindOptions()): Bson

Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a '$' sign.

Return

the $unwind pipeline stage

Parameters

fieldName

the field name, prefixed by a '$' sign

unwindOptions

options for the unwind pipeline stage