Questions tagged [doctrine-odm]

Doctrine Object Document Mapper is built for PHP 5.3.2+ and provides transparent persistence between PHP objects and data stores such as MongoDB, CouchDB, OrientDB, and PHPCR.

Doctrine Object Document Mapper is built for PHP 5.3.2+ and provides transparent persistence between PHP objects and data stores such as MongoDB, CouchDB, OrientDB, and PHPCR.

Related links

538 questions
1
vote
1 answer

Can I mimic doctrine's lazy load on postLoad

I have an entity User which has a OneToMany relation with an entity named Session. So far so good, I can do $myUser->getSessions() and get an array with all the sessions related to the $myUser. Session also had a OneToMany relation with another…
AdrienXL
  • 3,008
  • 3
  • 23
  • 39
1
vote
2 answers

Query for a Document Nested in an Array using Doctrine mongodb odm

I want to execute Document Nested in an Array queries with the Doctrine mongodb odm query builder I have basically a structure similar to : db.inventory.insertMany( [ { item: "journal", instock: [ { warehouse: "A", qty: 5 }, { warehouse: "C",…
louffi
  • 215
  • 5
  • 19
1
vote
1 answer

doctrine mongodb query builder projection with numbered indices

I need to limit the amount of data returned by a doctrine mongoDB query. I could use select to project to simple fields or even simple embedded array fields like normalizedData.ean. That works perfectly. However I have the necessary data in a form…
Micha
  • 523
  • 10
  • 26
1
vote
0 answers

[symfony][DoctrineMongoDBBundle] Error when generate schema indexes

I'm using Symfony3 and DoctrineMongoDBBundle. When I try to generate the mongodb schema I get the next Notice and, although I have the collections created, the indexes does not exists. $ bin/console doctrine:mongodb:schema:create Created dbs for all…
1
vote
0 answers

Doctrine ODM symfony 3: Find by value in a field

i want to get an array object of documents where an array fiel contains a specific value. My collection is something like : { "name" : "name", "groups" : ["id1","id2"] } Using doctrine_mongodb and repository, i want for example all the documents…
mockingbid
  • 169
  • 12
1
vote
1 answer

How do I sum multiple fields in doctrine odm?

I want to use doctrine odm's aggregation builder to build this query: db.TeamStandings.aggregate( // Pipeline [ // Stage 1 { $match: { "team.$id": ObjectId("5a1643fdf5d8741a883c2aeb") …
markedphp
  • 13
  • 5
1
vote
1 answer

How do I group by on a dbref in MongoDB with Doctrine

I want to do an aggregation query where I can group by a dbref. This is what I've tried. $aggregation = array( array( '$group' => array( '_id' => '$foreign.$id', 'doc' => array( '$last' =>…
KhorneHoly
  • 4,666
  • 6
  • 43
  • 75
1
vote
1 answer

Why is my PersistentCollection empty?

I'm using the Symfony 3 Framework with Doctrine and MongoDB. I've two documents that are in an OneToMany relationship. /** * Class Waypoint * @package AppBundle\Document * @MongoDB\Document(collection="waypoints",…
KhorneHoly
  • 4,666
  • 6
  • 43
  • 75
1
vote
0 answers

MongoDB Atlas SSL Connection reset by peer

I am using MongoDB Atlas cloud services with my Symfony 3 application and I am having lots of warnings in my PHP logs saying MongoClient::__construct(): SSL: Connection reset by peer. Even though I have warnings some times, I can connect…
Antoine P.
  • 11
  • 3
1
vote
1 answer

Flush only certain entities in single transaction

in my application I do write to a read model table (think CQRS) at certain times. While doing so, I also have to remove older read models. So at any given point I need to: Remove entities a,b,c Persist entities x,y,z In order to maintain a valid…
Jan
  • 907
  • 1
  • 8
  • 23
1
vote
0 answers

How to cache query result Symfony2+MongoDB (ODM)

I want to cache query result as my query is too heavy, it takes approx 2 - 5 minutes to execute, but Symfony2 + MongoDB do not support it currently according to it. Doctrine MongoDB result caching And I did not find anything after searching lots of…
Sunil Rawat
  • 709
  • 10
  • 41
1
vote
1 answer

How to build an Aggregation query in symfony with doctrine/mongodb?

I'm starting out with Symfony and doctrine/mongodb. I'm trying to do an aggregation query, but I get Attempted to call an undefined method named "createAggregationBuilder" of class "Doctrine\ODM\MongoDB\DocumentManager" with something like…
mywebstuff.hq
  • 43
  • 1
  • 6
1
vote
1 answer

MongoDb: Find documents which contain tags/keywords matching given string

i have a collection (Foo), which has "keywords" field. I want to find documents, which match given string (have at least one matching keyword), and sort them by number of matches. Foo: {name: 'Foo1', keywords: ['example', 'sample',…
Sycu
  • 43
  • 5
1
vote
1 answer

Doctrine ODM MongoDB EmbedOne Document not loaded

I need to store some data for our booking and thats include the customer data, which I want as embedded document within my booking document. With my current configuration all data are persisted in MongoDB, but when I load the booking document, there…
Daniel
  • 539
  • 4
  • 25
1
vote
1 answer

How to deploy PHP7 with MongoDB ext on Heroku?

I'm trying to deploy an app on Heroku and I'm running into issues related to conflicting composer dependencies. It's working fine from my local dev machine, I can composer update without any issue. Here is a sample of my composer.json: "require": { …
maphe
  • 1,904
  • 3
  • 20
  • 26