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

Doctrine MongoDB: Embeded documents will not be saved if hydrating data into main document

im using the hydrate function of the document manager (zend framework 2 application) for hydrating array data into a document. Unfortunately embeded sub documents will not be updated in the databse (but main document will do). Hydrating of the data…
2
votes
2 answers

MongoDB auto-increment counter document with Doctrine ODM

I need an auto-incrementing field in MongoDB. I've found documentation on how to use a counter-collection in MongoDB. However, my value id NOT the _id, it in not necessarily set and I need to use this through Doctrine ODM (which I am rather…
Josef Engelfrost
  • 2,955
  • 1
  • 29
  • 38
2
votes
0 answers

Test Doctrine ODM respository with phpunit in Symfony2

I want to test this simple query: public function findArticlesByUsers($ids) { $qb = $this->createQueryBuilder(); $qb ->addOr($qb->expr()->field('creator.id')->in($ids)) …
Biruwon
  • 394
  • 1
  • 4
  • 18
2
votes
0 answers

Doctrine mongo ODM duplicating embedded documents in Symfony

Using Doctrine mongo ODM 1.0.0-BETA8 in Symfony 2.2.1, I'm running into troubles with the update portion of CRUD. Upon persist() the new embedded documents are being duplicated. I ran the phpunit tests relating to embedded documents that come…
ojreadmore
  • 1,465
  • 2
  • 17
  • 33
2
votes
1 answer

ZF2 + DoctrineODM + doctrine-mongo-odm-module paginator tutorial

I have app on ZF2 + DoctrineODM + doctrine-mongo-odm-module and I can't find examples how to create pagination with these modules. Is there any example to do this?
2
votes
0 answers

MongoDB ODM - Group by MAX(group_id)

Let me get to the point, I am currently using the Doctrine MongoDB ODM in conjunction with Symfony2 to persist data into MongoDB. Currently I am grouping my results by type, but I would like to group them by MAX(group_id) as well. Sure I can just…
Odyss3us
  • 6,457
  • 18
  • 74
  • 112
2
votes
1 answer

How to properly Autoload Doctrine ODM annotations?

Trying to run the command line tool w/ odm:schema:create and I'm getting errors like: "[Semantical Error] The annotation "@Document" in class Company_Model_Auth was never imported. Did you maybe forget to add a "use" statement for this…
Mike Graf
  • 5,077
  • 4
  • 45
  • 58
2
votes
2 answers

Symfony 2 Forms and Doctrine Mongo - How to render @Embed and @Hash properties?

I'm totally stuck in combination of Symfony Forms and Doctrine MongoDb and need your help. I have a User class with @EmbedMany and @Hash: /** * @MongoDB\Document */ class User { /** * @MongoDB\EmbedMany(targetDocument="Project",…
marden
  • 470
  • 6
  • 10
2
votes
2 answers

Document serialization with Doctrine MongoDB ODM

I'm trying to code a class handling serialization of documents by reading their metadata. I got inspired by this implementation for entities with Doctrine ORM and modified it to match how Doctrine ODM handles documents. Unfortunatly something is not…
2
votes
0 answers

DUPLICATE KEY ERROR same error message on different value

I get the same message error (duplicate key error index with same id on different value) when I would like to insert value after a failed. Key exist for value 15 to 17 in MONGODB, exception will be thrown. It's normal uses case but I get the same…
2
votes
1 answer

Doctrine MongoDB ODM Authentication, possible?

Is there a way to use MongoDB authentication in Doctrine MongoDB ODM? equivilant to db.auth(username,password) in shell
Omar
  • 8,374
  • 8
  • 39
  • 50
2
votes
1 answer

Doctrine2 ODM - Object ( or Embedded Document ) as _id

I have a process running an incremental map reduce to a collection where I am looking at metrics over different time periods - grouping by id(s) and date. So my output collection essentially has a composite id to handle the grouping. { "_id" :…
kmfk
  • 3,821
  • 2
  • 22
  • 32
2
votes
3 answers

Is there a smarter way to get a referenced documents ID without querying for it and hydrating it?

I have a document which contains references to some other documents. Like most people, I am using a MongoId in an "id" field in URLs in order to view these documents. The situation is that I want to display links to these referenced documents from…
MDrollette
  • 6,887
  • 1
  • 36
  • 49
2
votes
1 answer

How do I deserialize a Doctrine object with JMSSerializerBundle?

I am using Doctrine-ODM and I'm trying to (de)serialize document Objects in Symfony. The serialization seems to work, but when I try to deserialize I get the following error: You must define a type for My\Bundle\Repository\Item::$id. I try to…
Senči
  • 911
  • 2
  • 10
  • 25
2
votes
1 answer

How do I query for all items which have a specific item embeded in doctrine odm

I have Comments for something and it's possible to like them. The likes are saved in the Comments as EmbedMany(targetDocument=User). I want to query for all Comments a Specific User has liked, how do I do that? I thought of something…
Senči
  • 911
  • 2
  • 10
  • 25