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
7
votes
5 answers

Binding Zend2 form data from doctrine2 ODM

Is there a better way to bind data from a doctrine2 ODM entity class to a Zend2 form besides using bind()? If so, what would it be? Would I just retrieve the data as an array and pass each individual field? I am struggling with this and most likely…
bl4design
  • 117
  • 1
  • 8
7
votes
1 answer

How to remove multiple documents in Doctrine MongoDB ODM

How can I remove multiple documents in doctrine mongodb odm? In PHP class I should be able to do it using the following code: $db->collection->remove(array("age" => 18)); How can I do it in doctrine mongo odm?
dextervip
  • 4,999
  • 16
  • 65
  • 93
6
votes
1 answer

Doctrine ODM - like operator syntax

how would i go about simulating the like operator from SQL in doctrine odm? use case: i want to find a Theme that has somewhere in the field caption string in a variable $search. How would the query look like? thanks for all answers
bazo
  • 745
  • 9
  • 26
6
votes
3 answers

PHP 7 with Doctrine MongoDB ODM

I have a Symfony 2 application that is using Doctrine MongoDB ODM and I'm trying to get this running with PHP 7. I have installed PHP 7 successfully but installing dependencies through Composer is giving me grief with the following…
Luke
  • 20,878
  • 35
  • 119
  • 178
6
votes
5 answers

doctrine2 order by array with ids

How I can with doctrine2 order by array with ids ? I have this query: $qb = $this->createQueryBuilder('u') ->select('u', 'n', 'c') ->leftJoin('u.notifications', 'n') ->leftJoin('u.channel', 'c') ->andWhere('u.id IN…
6
votes
2 answers

MongoException: zero-length keys are not allowed, did you use $ with double quotes?

I'm using symfony2 and mongodb, until today, everything is OK, but I create a new document, and suddenly, appears this error : "MongoException: zero-length keys are not allowed, did you use $ with double quotes?" $dm =…
6
votes
2 answers

How do I update embedded documents in Doctrine MongoDB?

I have a document that has a document embedded. When I create an object for the first time everything works fine, but when I try to update a document, the embedded document does not get updated. /** @MongoDB\Document */ class DocumentA { /**…
Florian Eckerstorfer
  • 1,526
  • 1
  • 14
  • 21
6
votes
1 answer

PHP Mongo: Notice: Mongo::__construct(): parsing servers

I am wondering why I am getting the following php notice: ( ! ) Notice: Mongo::__construct(): parsing servers in C:\htdocs\multishop\library\Lupi\Resource\Odm.php on line 38 Call Stack # Time Memory Function Location 1 0.0004 138504 …
dextervip
  • 4,999
  • 16
  • 65
  • 93
6
votes
3 answers

How to integrate ZF2 with Doctrine Mongo ODM?

I am trying to integrate zf2 beta3 with doctrine mongo odm (https://github.com/doctrine/DoctrineMongoODMModule) but no sucess. How can I install and configure it?
6
votes
2 answers

MongoDB/doctrine: can't nest $or in $and

I'm having trouble nesting multiple two-operand $or operations within an $and operation. The conclusion of this discussion sounds similar what I need, but I'm unable to get it to work. Here's JavaScript of what I'm trying to do: db.Business.find( …
Adam Monsen
  • 9,054
  • 6
  • 53
  • 82
5
votes
1 answer

Query document based on a reference to a cached object

I have two types of objects User and Company whose data is stored in MongoDB collections user and company. User contains a reference to Company. I can query for user using the following code in the UserRepository: $this ->createQueryBuilder() …
Sander Toonen
  • 3,463
  • 35
  • 54
5
votes
2 answers

Doctrine ODM and schema-less design

Continuing on from my question about EAV, I'm considering using MongoDB to store product attributes. I will store the catalogue part of this app - Categories, Products and all their related information - with MongoDB (or another document…
Cobby
  • 5,273
  • 4
  • 28
  • 41
5
votes
2 answers

Using Doctrine's MongoDB ODM - How do I find documents by embedded documents' fields?

I have the following Documents: A User document. An embedded document, containing a reference to (see next document) a Site document Each user has an array of embedded documents inside, each representing an item he follows - a site, a twitter…
Doron
  • 3,176
  • 7
  • 35
  • 60
5
votes
2 answers

doctrine mongodb intallation error through composer

I am trying to install Doctrine MongoDB ODM module through composer with Zend Framework 2 on my local machine but I keep getting an error stating that PHP extension mango is missing from my computer. I am working on a Windows 7 x64 with WAMP 2.2…
paxtor
  • 331
  • 5
  • 17
5
votes
2 answers

Doctrine+MongoDB - How to query for documents with array that's not empty

I would like to receive all the documents with array "likes" with size greater than zero. I saw an example of using the ->size() method to get an array in a specific size: $qb = $dm->createQueryBuilder('Article')->field('comments')->size(0); but…
Geva Tal
  • 340
  • 3
  • 14
1
2
3
35 36