You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to setup this adapter in a legacy app. When I am executing MongoDB ODM queries in the setup with the mongo-php-adapter, I have the error below returned by Doctrine for the following snippets:
$result = $this
->createQueryBuilder()
->field('someId')->equals(new MongoId($dto->getId()))
->hydrate(true)
->field('someField')->notEqual(true)
->getQuery()
->execute();
die(json_decode($result)); // As an example, originally the function returned the query builder ( \Doctrine\MongoDB\Query\Builder), which was then passed to Knp paginator
Error: Cannot use object of type MyBundle\Document\SomeDocument as array
at n/a
in /var/www/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/UnitOfWork.php line 2687
The code fragment that returns with Symfony Stack Trace is as follows:
in vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/UnitOfWork.php at line 268
$isManagedObject = false;
if (! $class->isQueryResultDocument) {
$id = $class->getDatabaseIdentifierValue($data['_id']);
$serializedId = serialize($id);
$isManagedObject = isset($this->identityMap[$class->name][$serializedId]);
}
PHP 5.6 sounds a bit of bad manners in 2024, I know.
Currently, there is a mix of Doctrine ODM usages and MongoDB driver usages. We are trying to move from the Mongo 3.4 to the latest version possible (it seems to be mostly compatible with MongoDB 4.4) to start decoupling and splitting our big legacy app and shutting it down.
I will be glad for any help or advice, thank you in advance!
The text was updated successfully, but these errors were encountered:
Hi!
I have tried to setup this adapter in a legacy app. When I am executing MongoDB ODM queries in the setup with the mongo-php-adapter, I have the error below returned by Doctrine for the following snippets:
The code fragment that returns with Symfony Stack Trace is as follows:
No other useful information was provided.
Now having the following configuration:
composer.json related libraries:
PHP 5.6 sounds a bit of bad manners in 2024, I know.
Currently, there is a mix of Doctrine ODM usages and MongoDB driver usages. We are trying to move from the Mongo 3.4 to the latest version possible (it seems to be mostly compatible with MongoDB 4.4) to start decoupling and splitting our big legacy app and shutting it down.
I will be glad for any help or advice, thank you in advance!
The text was updated successfully, but these errors were encountered: