lookup

fun <FROM : Any> lookup(from: MongoCollection<FROM>, localField: KProperty1<out Any, Any?>, foreignField: KProperty1<FROM, Any?>, newAs: KProperty1<out Any, Any?>): Bson

Creates a $lookup pipeline stage for the specified filter (Typesafe version)

Return

the $lookup pipeline stage

Parameters

from

the collection in the same database to perform the join with.

localField

specifies the field from the local collection to match values against.

foreignField

specifies the field in the from collection to match values against.

newAs

the name of the new array field to add to the input documents.