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
24
votes
0 answers

How to properly handle denormalized data synchronization in Doctrine MongoDB ODM

Denormalization of referenced data seems a pretty common practice when using MongoDB. Yet, I do not see any built-in way to handle that with Doctrine MongoDB ODM. Let's say I have a social network where users can follow each other, here are two…
7
votes
2 answers

Doctrine MongoDB - is there any way to build a query from JSON?

I have an arbitrary MongoDB JSON find query string, for example: { "address.city": "Seattle"} or { qty: { $gt: 5, $lt: 50 } Is there any existing method to create a Doctrine.MongoDB.Query object from the JSON string? Or alternately to query mongo…
tgreiser
  • 393
  • 3
  • 13
6
votes
2 answers

Symfony2 MongoDB Multiple connections error

I have an issue setting up MongoDB in Symfony2. Specs: "Symfony": "2.6.*" "doctrine/mongodb-odm": "1.0.*@dev", "doctrine/mongodb-odm-bundle": "3.0.*@dev" I have 2 databases used in 2 different bundles, nxtlog and nxtsurvey, in MongoDB. The original…
nicom974
  • 176
  • 13
6
votes
1 answer

ClassNotFoundException: Attempted to load class "Mongo" from... (with persist) symfony2

I am having some issue integrating mongodb with Symfony (version 2.5.0-DEV) using the doctrine mongodb cookbook on http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html. Everything is okay up to the 'Persisting Objects to MongoDB'…
Kingsley
  • 183
  • 1
  • 15
5
votes
2 answers

Is the Doctrine Migrations project compatible with Doctrine MongoDB?

Is the Doctrine Migrations project compatible with Doctrine MongoDB? It isn't clear to me from searching and looking at the Doctrine Migrations project whether it is compatible with ODM solutions (e.g. MongoDB) as well as ORM solutions. If it is,…
Sean Quinn
  • 2,131
  • 1
  • 18
  • 48
5
votes
2 answers

Symfony2 Form pre-fill fields with data

Assume for a moment that this form utilizes an imaginary Animal document object class from a ZooCollection that has only two properties ("name" and "color") in symfony2. I'm looking for a working simple stupid solution, to pre-fill the form fields…
mate64
  • 9,876
  • 17
  • 64
  • 96
3
votes
0 answers

Change mongodb timeout value

I am running mongodb in docker container and i want to increase the timeout value from 30 sec to like 2 min but i dont know where to change. As my request is taking more time and causing below error: {"code":500,"message":"Error: Maximum execution…
Maqsood
  • 369
  • 4
  • 17
3
votes
2 answers

DoctrineMongoDBBundle: Specify Read Preference to Document Manager

I'm connecting to a remote database that is configured only for reading. If I use: $connection = new \MongoClient($server); $dbname =…
Alex
  • 51
  • 2
3
votes
1 answer

Doctrine MongoDB delete reference only onRemove

I have a OneToMany Relationship between a ChartPage and a BaseChart: 1 ChartPage holds 1 BaseChart and 1 BaseChart holds many ChartPages Charts are managed in a different bundle of my application, so they can be removed individually. What I like to…
con
  • 2,358
  • 25
  • 33
3
votes
1 answer

How sort an array in a collection

I've been looking for sorting a specific inner array in a collection, I use doctrine-mongodb-bundle in symfony2. My collection : "page": { "_id": "56rgt46rt54h68rt4h6" "categories": [{ "_id": "2g56rt1h65rt165165erg4" …
3
votes
1 answer

How to annotate sub-documents in Doctrine MongoDB?

I want to implement php classes that should model the following : (Symfony,DoctrineMongoDBBundle) Notification Collection { from { id , fname } , to , sentDate } Member Collection { id , fname , lname , email , phone , regDate , ... } And i want…
ABS
  • 2,626
  • 3
  • 28
  • 44
3
votes
2 answers

Can't retrieve value of a field of type @Collection using DoctrineMongoDBBundle

I have the following definition of a MongoDB Document (I stripped down parts of the class for brevity): // src/Acme/UserBundle/Document/User.php namespace Acme\UserBundle\Document use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB; use…
amanya
  • 75
  • 6
3
votes
2 answers

Can't install doctrine/mongodb-odm using Composer

Trying to install doctrine/mongodb-odm via Composer I get this: Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. …
Jack Sleight
  • 17,010
  • 6
  • 41
  • 55
3
votes
2 answers

Atomic update on multiple documents in doctrine mongodb

I work on a project with symfony2 and doctrine-mongodb-odm. I want to execute an atomic update on several documents with the querybuilder but I am missing…
JuCachalot
  • 1,010
  • 4
  • 15
  • 27
3
votes
2 answers

EmbedMany Strings in an MongoDB Document?

I need to have a simple array/collection of strings in my Document, but cannot work out a way to acheive this with Doctrine ODM. This is an example class/document, with $tags needing to be a simple array of strings: namespace…
Rob Holmes
  • 3,768
  • 1
  • 16
  • 19
1
2 3 4 5 6