Skip to content

PHPLIB-85: Legacy index creation should use {w:1} #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/Operation/CreateIndexes.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use MongoDB\Driver\Command;
use MongoDB\Driver\Server;
use MongoDB\Driver\BulkWrite as Bulk;
use MongoDB\Driver\WriteConcern;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\Exception\RuntimeException;
use MongoDB\Exception\UnexpectedTypeException;
Expand Down Expand Up @@ -113,6 +114,6 @@ private function executeLegacy(Server $server)
$bulk->insert($index);
}

$server->executeBulkWrite($this->databaseName . '.system.indexes', $bulk);
$server->executeBulkWrite($this->databaseName . '.system.indexes', $bulk, new WriteConcern(1));
}
}
9 changes: 9 additions & 0 deletions tests/Collection/CollectionFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ public function testDrop()
$this->assertCollectionCount($this->getNamespace(), 0);
}

/**
* @expectedException MongoDB\Exception\InvalidArgumentException
* @todo Move this to a unit test once Manager can be mocked
*/
public function testDropIndexShouldNotAllowWildcardCharacter()
{
$this->collection->dropIndex('*');
}

public function testFindOne()
{
$this->createFixtures(5);
Expand Down
193 changes: 0 additions & 193 deletions tests/Collection/IndexManagementFunctionalTest.php

This file was deleted.

Loading