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
0
votes
1 answer

Unable to find Mongo class in Connection.php Symfony 2

This is quite an often occurring error, but since I tried a lot of stuff to fix it, I'm kind of getting out of the ideas. I have a symfony 2 with mongo DB. I have set up my composer.json file to download doctrine-mongo and…
Michal Takáč
  • 1,005
  • 3
  • 17
  • 37
0
votes
3 answers

How to apply a unique validator constraint using Silex and Doctrine MongoDB ODM?

I'm using Silex and would like to apply uniqueness validator constraints on MongoDB documents. The UniqueEntity validator constraint to be found in symfony/doctrine-bridge wasn't designed to work with doctrine/mongodb-odm but solely with the ORM…
David
  • 2,603
  • 4
  • 18
  • 28
0
votes
1 answer

Can't get referenced entity properties anytime, only in rendering method

/** @ODM\Document(collection="Entities") */ class Entity extends Document { /** @ODM\Id */ protected $_id; /** @ODM\ReferenceOne(targetDocument="\Doctrine\Documents\Entities\Entity2", simple=true) */ protected $entity2; } /**…
simPod
  • 11,498
  • 17
  • 86
  • 139
0
votes
1 answer

In Doctrine, what does dollar sign mean in dot syntax like, property.$.otherProperty?

In Doctrine, what does dollar sign mean in dot syntax like, property.$.otherProperty? I noticed in /Doctrine/ODM/MongoDB/Tests/Query there is an interesting queryBuilder argument, field('phonenumbers.$.phonenumber') where, in the User class,…
CommaToast
  • 11,370
  • 7
  • 54
  • 69
0
votes
1 answer

How do I obtain all documents referenced by a single document?

If I have a document Shop that has many Activities defined as ReferenceMany, is there a way I can directly query for the list of Activities for a Shop without hydrating a Shop instance? For example: { "_id": fd390j09afj09dfj, "activities":…
Alexander Trauzzi
  • 7,277
  • 13
  • 68
  • 112
0
votes
1 answer

generate mapping and documents in Symfony 2 for mongodb?

Im using DoctrineMongoDBBundle and I was wondering if it's possible to generate mapping information and documents from an existing mongodb database. Just like the following set of commands would do with the ORM: doctrine:mapping:convert;…
mb3rnard
  • 397
  • 3
  • 12
0
votes
0 answers

How can I fetch just a document without his referenced documents

I have two Documents: Client and PV. Many PV are referenced in one Client. It's unidirectional. Client /** * @MongoDB\Document */ class Client { /** * @MongoDB\Id(strategy="auto") */ protected $id; /** *…
RChanaud
  • 194
  • 2
  • 12
0
votes
1 answer

Doctrine MongoDB ODM search query

I want to create a full text search with mongodb. How can I create the following query. With the query builder API? db.Item.runCommand("text", {search: "Awesome"}); Is that possible? Or how can I execute a native query. Thanks for help.
createproblem
  • 1,542
  • 16
  • 30
0
votes
3 answers

How do I add an object into MongoDB using Doctrine?

I use Doctrine Mongo db bundle with Symfony2. Information about string, int etc data types in the Doctrine Mongodb documents. But, I could not find object data types. The question: How do I add an object into MongoDB using Doctrine? How do I define…
user2993220
  • 83
  • 2
  • 7
0
votes
1 answer

Query Builder not working if expression was separated into a few expressions

I'm woking with the last version of the Doctrine ODM (Mongodb). This works: $items = $om->createQueryBuilder($itemClass) ->field('active')->equals(true) ->getQuery()->execute(); This doesn't work: $items =…
ozahorulia
  • 9,798
  • 8
  • 48
  • 72
0
votes
2 answers

how to create doctrine mongodb connections via DriverManager

Is there a way to create mongodb connection using doctrine's DriverManager::getConnection() method? Most of examples use yaml file to configure connections. I am looking for a way to make doctrine-mongodb connections only with php code.
Muatik
  • 4,011
  • 10
  • 39
  • 72
0
votes
1 answer

Get the stored date in symfony2 doctrine mongodb

I have created a console command page in my bundle for cronjob. Here is the code class MyCommand extends Command { protected function configure() { $this ->setName('cron:item_email') ->setDescription('product notification for…
Lal Mohan
  • 323
  • 1
  • 7
  • 21
0
votes
1 answer

How to create a form field which is referenced to another document using formbuilder in symfony2?

In my document I have a category member attribute which is referenced to the same class Category /** * Parent Category's path ( Indexed ) * * @var String * @MongoDB\ReferenceOne( targetDocument = "Category", simple="true" ) */ protected…
aditya
  • 996
  • 2
  • 12
  • 25
0
votes
2 answers

Invalid Type Error Occasionally in Symfony 2 Console

I have a Symfony 2 environment in which I am using a custom data type with Doctrine's MongoDB ODM mappings. This all works, except occasionally; when I go to clear the cache or install the assets I sometimes receive the following…
Sean Quinn
  • 2,131
  • 1
  • 18
  • 48
0
votes
2 answers

How to turn on logging (profiling) using ZF2 Doctrine MongoDb module

I've successfully integrated Doctrine MongoDB module in Zend Framework 2 and now I need to keep track of each query to MongoDB. Does anybody know how to turn on logging?
Pavel
  • 548
  • 5
  • 23