Skip to content

Unable to use useCursor false in aggregate #121

@nalscher

Description

@nalscher

I can't do this :

$collection->aggregate($pipeline, [
'useCursor' => false,
]);

i have always the error :
"typeMap" option should not be used if "useCursor" is false

even if i do this :
$collection->aggregate($pipeline, [
'useCursor' => false,
'typeMap' => null
]);

or
$database->selectCollection('calls', [
'typeMap' => null
]);

i think it's due to :
Collection.php line 112 : $this->typeMap = isset($options['typeMap']) ? $options['typeMap'] : self::$defaultTypeMap;
and in the same file line 163 :
if ( ! isset($options['typeMap'])) {
$options['typeMap'] = $this->typeMap;
}

we always have a value in typeMap, the default or the custom one but never null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions