Lookup constructor
Lookup({})
Creates ordinary $lookup
stage
from
- Specifies the collection in the same database to perform the join with. The from collection cannot be sharded.localField
- Specifies the field from the documents input to the$lookup
stage.$lookup
performs an equality match on thelocalField
to theforeignField
from the documents of the from collection. If an input document does not contain thelocalField
, the$lookup
treats the field as having a value ofnull
for matching purposes.foreignField
- Specifies the field from the documents in the from collection.$lookup
performs an equality match on theforeignField
to thelocalField
from the input documents. If a document in the from collection does not contain theforeignField
, the$lookup
treats the value asnull
for matching purposes.as
- Specifies the name of the new array field to add to the input documents. The new array field contains the matching documents from the from collection. If the specified name already exists in the input document, the existing field is overwritten.
Implementation
Lookup(
{required String from,
required String localField,
required String foreignField,
required String as})
: super(
'lookup',
AEObject({
'from': from,
'localField': localField,
'foreignField': foreignField,
'as': as
}));