Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,11 @@ public function createIndexes(string $collection, array $indexes, array $options
if (\array_key_exists('unique', $index) && $index['unique'] == true) {
/**
* TODO: Unique Indexes are now sparse indexes, which results into incomplete indexes.
* However, if partialFilterExpression is present, we can't use sparse.
*/
$indexes[$key] = \array_merge($index, ['sparse' => true]);
if (!\array_key_exists('partialFilterExpression', $index)) {
$indexes[$key] = \array_merge($index, ['sparse' => true]);
}
}
}

Expand Down