alcaeus / mongo-php-adapter

:link: Adapter to provide ext-mongo interface on top of mongo-php-library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError with mongodb/mongodb 1.3

nick-zh opened this issue · comments

commented
        <div>
            <strong>Type:</strong> TypeError
        </div>
        <div>
            <strong>Message:</strong> Argument 3 passed to MongoDB\Driver\Server::executeQuery() must be an instance of MongoDB\Driver\ReadPreference or null, array given
        </div>
        <div>
            <strong>File:</strong> /var/www/html/vendor/mongodb/mongodb/src/Operation/Find.php
        </div>
        <div>
            <strong>Line:</strong> 287
        </div>
        <h2>Trace</h2>
        <pre>#0 /var/www/html/vendor/mongodb/mongodb/src/Operation/Find.php(287): MongoDB\Driver\Server-&gt;executeQuery('datapool.client', Object(MongoDB\Driver\Query), Array)
#1 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(530): MongoDB\Operation\Find-&gt;execute(Object(MongoDB\Driver\Server))
#2 /var/www/html/vendor/alcaeus/mongo-php-adapter/lib/Mongo/MongoCursor.php(166): MongoDB\Collection-&gt;find(Object(MongoDB\Model\BSONDocument), Array)
#3 /var/www/html/vendor/alcaeus/mongo-php-adapter/lib/Mongo/MongoCursor.php(467): MongoCursor-&gt;doQuery()
#4 /var/www/html/vendor/alcaeus/mongo-php-adapter/lib/Alcaeus/MongoDbAdapter/AbstractCursor.php(297): MongoCursor-&gt;ensureCursor()
#5 /var/www/html/vendor/alcaeus/mongo-php-adapter/lib/Alcaeus/MongoDbAdapter/AbstractCursor.php(190): Alcaeus\MongoDbAdapter\AbstractCursor-&gt;ensureIterator()
#6 /var/www/html/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Cursor.php(550): Alcaeus\MongoDbAdapter\AbstractCursor-&gt;rewind()
#7 /var/www/html/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Cursor.php(726): Doctrine\MongoDB\Cursor-&gt;Doctrine\MongoDB\{closure}()
#8 /var/www/html/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Cursor.php(551): Doctrine\MongoDB\Cursor-&gt;retry(Object(Closure), false)
#9 [internal function]: Doctrine\MongoDB\Cursor-&gt;rewind()
#10 /var/www/html/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Cursor.php(690): iterator_to_array(Object(Doctrine\MongoDB\LoggableCursor), false)
#11 /var/www/html/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Cursor.php(726): Doctrine\MongoDB\Cursor-&gt;Doctrine\MongoDB\{closure}()
#12 /var/www/html/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Cursor.php(691): Doctrine\MongoDB\Cursor-&gt;retry(Object(Closure), true)
#13 /var/www/html/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Cursor.php(327): Doctrine\MongoDB\Cursor-&gt;toArray()
#14 /var/www/html/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php(508): Doctrine\MongoDB\Cursor-&gt;getSingleResult()
#15 /var/www/html/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/DocumentRepository.php(146): Doctrine\ODM\MongoDB\Persisters\DocumentPersister-&gt;load(Array)
#16 /var/www/html/app/Repository/Repository.php(56): Doctrine\ODM\MongoDB\DocumentRepository-&gt;find('732992d4-9fb1-4...')

When reporting an error, it's a good idea to not just dump a trace. For example, it'd be helpful to know what the query looked like, etc. Please reopen this issue with the appropriate information. Thank you.

commented

yeah sry, thought the information that passing an array instead of null / ReadPreference was enought, next time

For more information regarding this issue, see mongodb/mongo-php-driver#757 (comment). The issue is most likely caused due to invalid dependency resolution, e.g. because of --ignore-platform-reqs on composer update.