Questions tagged [doctrine-mongodb]

Doctrine MongoDB Object Document Mapper provides transparent persistence for PHP objects to the MongoDB database.

Doctrine MongoDB Object Document Mapper is built for PHP 5.3.0+ and provides transparent persistence for PHP objects to the popular MongoDB database by 10gen.

76 questions
1
vote
1 answer

Saving an associative array with references as values in doctrine-mongodb

How can I map a field inside a document as associative array whose values are references to another document? Let's say I have a document File which represents some file on disk. Something like this: /** @Document */ class File { /** @Id */ …
ochnygosch
  • 111
  • 2
1
vote
1 answer

Mongo Query Builder Skip is completely ignored. Bug?

Following the examples at: http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/query-builder-api.html I have: $dm = $this->get('doctrine.odm.mongodb.document_manager'); $query =…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
1
vote
3 answers

findBy reference doctrine-mongodb

I have collections of users and posts. User looks like { "_id" : ObjectId("5089cc4c7b03b9902b000000"), "facebook_id" : "522128874" } Post looks like { "_id" : ObjectId("508aa21b7b03b9780800000f"), "facebook_id" : "10150709375878875", "user" :…
0
votes
0 answers

doctrine-mongodb field mapping

i have a problem fetching data with doctrine-mongodb bundle. If i use the "protected" access modifier for the document's fields, the fetched objects are empty. Here is an example of the class:
Faber
  • 33
  • 5
0
votes
0 answers

doctrine-mongodb-odm Embed Document

im working with on a project with Symfony + doctrine-mongodb-odm + MongoDB. I have two classes Product and productCategory as shown here :
Aymen
  • 13
  • 4
0
votes
0 answers

ParameterNotFound: missing dependency on using staticphp as mapping-type in DoctrineMongoDBBundle

I try to use staticphp as mapping type as it is described in the documentation, but as soon as I update my config from annotation into staticphp I get an error saying, that the driver is missing a service…
0
votes
1 answer

Doctrine-MongoDB postLoad triggers preUpdate when creating new document

I have a model with some crypted fields, on postLoad I uncrypt the fields (works well) and I try to create a new document (a log to keep track of the reading). My problem is, if I flush my new Log document into this postLoad, a preUpdate for my…
Spope
  • 481
  • 5
  • 22
0
votes
0 answers

Doctrine MongoDB - Hydrate results inside a facet using Doctrine MongoDB Aggregation Builder

I have the following query and I want the first result to be hydrated. This is what I tried: $builder = $dm->createAggregationBuilder(\Documents\Jobs::class); $builder ->facet() ->field('carpenterJobs') ->pipeline( …
Lucas Borges
  • 140
  • 2
  • 13
0
votes
0 answers

How should I prophesy the sort method?

I am using the DoctrineMongoDBBundle and I am not sure how to prophesy the sort method. Source $qb = $dm->createQueryBuilder('Article') ->sort('createdAt', 'desc'); My code is: UserRepository - Method All public function all(array $input = null) …
Rafael
  • 37
  • 4
0
votes
1 answer

Doctrine MongoDB how to get Embedded Document in PersistentArray as its actual class instead of Array

My document is an ItemsList, having an Items embedded document. The problem is that Doctrine Mongo is not mapping the embedded document as an Item object, but as an array. Is this correct? How would I update an Item in an OOP…
JorgeeFG
  • 5,651
  • 12
  • 59
  • 92
0
votes
1 answer

Install doctrine-mongodb-admin-bundle::error:To enable extensions, verify that they are enabled in your .ini files:

I am using Symfony 3.4 Flex and sonata-admin-bundle": "^3.33" & "php": "^7.0.8"...i want to installing doctrine-mongodb-admin-bundle.when i run php composer.phar require sonata-project/doctrine-mongodb-admin-bundle 3.*@dev I have this error…
0
votes
1 answer

Adding references to a Document from controller without previously querying the DB (Symfony/Doctrine MongoDB)

I've already searched on StackOverflow and read the corresponding chapters of the Doctrine documentation (http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/index.html) but can't find what I'm looking for. I'm working on an API…
Enzo
  • 5
  • 1
  • 3
0
votes
2 answers

Doctrine MongoDB disable logger on fixture load

Is there a way to disable Doctrine MongoDB bundle logger on fixture load only? like suggested in https://stackoverflow.com/a/35222045/3965970 but for MongoDB bundle. Thanks
Billiam
  • 34
  • 4
0
votes
1 answer

Doctrine mongodb-odm aggregation builder query with ObjectId

I have the following user document config in yml mapping with id field as MongoId. I have use case that is required me to use aggregation builder to project data. When the result is available, the document _id will return as MongoId Object. Does…
0
votes
1 answer

Error: doctrine.mongodb:generate:document No bundle Bundle was found with Symfony3

Error: doctrine.mongodb:generate:document No bundle Bundle was found with Symfony3. c:\Bitnami\wampstack-5.6.20-0\apache2\htdocs\sym\patmonS1>php bin/console doctrine:mongodb:generate:document PatmonBundle:Product PHP Warning: Module 'mongo'…
olga
  • 959
  • 1
  • 15
  • 42