Replaces the usages of DBDirectClient::query() in DocumentSourceLookUp
and DocumentSourceGraphLookUp to instead parse and execute a Pipeline.
Simplifies the registration process of the "inner" plan execution in an
aggregation pipeline. The DocumentSourceCursor class now owns its
PlanExecutor and the PipelineProxyStage class no longer has a
std::weak_ptr to it. The "inner" plan executor is registered with the
CursorManager of the underlying Collection and will receive invalidation
notifications if a catalog operation occurs.
If the value in 'localField' is an array, assume that it corresponds to
multiple entries in the foreign collection. The query to the foreign
collection will use a $in predicate, except when a regex is present, in
which case it will use a series of $eq predicates within an $or.
Implements expressions for dealing with week as described in the
ISO-8601 standard (https://en.wikipedia.org/wiki/ISO_week_date).
Also implements the %G, %V, and %u specifiers for $dateToString.
Closes#1068
This fixes an issue where the DBDirectClient used by the $lookup stage
would have the previous OperationContext and trigger an invalid memory
access when sending a getMore request as it unwinds the results.
Calling PipelineProxyStage::doDetachFromOperationContext() now causes
the DBDirectClient's OperationContext to be set to nullptr, and
PipelineProxyStage::doReattachToOperationContext() causes it to be set
to the current OperationContext.
The default ShardingTest verbosity is currently zero, but we have many
tests, which bump it to 1 and even higher.
Since verbosity level of 0 is sometimes insufficient for investigating
transient failures, this change makes the default to be 1 and removes all
places, which explicitly make it 1 or higher.
Adds a includeArrayIndex option to the $unwind stage. If this option is
specified, the $unwind stage will output values with the structure {index:
<array index>, value: <array value>} instead of just the array value.
Note this does not affect the behavior non-arrays or empty arrays. If
includeArrayIndex and preserveNullAndEmptyArrays are both specified, values
from a non-empty array will have an index attached, and all other values will
pass through unchanged.
Adds a preserveNullAndEmptyArrays option to the $unwind stage. If this option
is specified, the $unwind stage will allow documents with nullish values for
the specified unwinding path, or those with an empty array as the value for
that path, to pass through unaltered.
Note this does not affect the behavior of non-nullish, non-array values.