Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-876

Create index with collation not working

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 1.2.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      PHP 7.0.10 64 bit
      MongoDB 3.4 64 bit
      php_mongodb-1.2.2-7.0-ts-vc14-x64
      mongo-php-library v1.1
      Windows 10 64 bit
      Apache 2.4 64 bit

      Hi

      I cannot create index with collation on my local env.

      Script:
      $result = $collection->createIndex(array('city' => 1), array('collation' => array('locale' => "en", 'strength' => 2)));

      Error:
      Invalid index specification { key:

      { city: 1 }

      , collation:

      { locale: "en", strength: 2 }

      , ns: "orgDb.testing", name: "city_1" }; cannot create an index with the 'collation' option and v=1

      ...\vendor\mongodb\mongodb\src\Operation\CreateIndexes.php:138

      When I do the same thing on my prod. setup it works!
      Windows Server 2012 R2 Standard 64 bit
      PHP 7.0.09 64bit
      MongoDB 3.4 64 bit
      php_mongodb-1.2.2-7.0-nts-vc14-x64
      mongo-php-library v1.1
      IIS

            Assignee:
            derick Derick Rethans
            Reporter:
            jesperbendtsen83@gmail.com Jesper Erik Bendtsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: