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
1
vote
0 answers

Sylius grid creation for doctrine mongo

I want to create a grid to display mongo documents using doctrine/mongodb odm driver. but i am getting the error " The parameter "sylius.mongodb.odm.repository.class" must be defined.". To solve this issue i have added the repository as…
1
vote
0 answers

How to add multiple images to edit form using MongoDB in Sonata?

I'm trying to find out how I can have the edit action of a Document (Entity) that is using an array of Object IDs to store the ID of an image stored using GridFS. This is a one-to-many but using an array inside the Document, instead of a middle…
1
vote
1 answer

symfony4: There is no extension able to load the configuration for "doctrine_mongodb"

I have an issue to configure doctrine odm with Symfony4.1 I got an error message on composer update, cache:clear subcommand There is no extension able to load the configuration for "doctrine_mongodb" (in …
Thomas Dupont
  • 417
  • 6
  • 20
1
vote
1 answer

I do not know how to test the create query builder

I'm trying to test the all method of a repository, but I do not know how to do the test, I want to use Profecy. I'm using DoctrineMongoDBBundle. Entity class UsuarioEntidade{ /** * @MongoDB\Id */ protected $usuId; /** *…
Rafael
  • 37
  • 4
1
vote
0 answers

Doctrine and MongoDb: Define required fields in MongoDb-Document (

I'm using MongoDB with Doctrine for a Symfony project. For a document (I call it class Product) I need to define a field (e.g. name), but I want to act doctrine in a way that the document cannot be saved without defining a it. Meaning, whenever…
codiga
  • 537
  • 5
  • 15
1
vote
1 answer

"Array to string conversion" error when using hash in Document

I'm attempting to use the hash type for a Document. When I'm creating an object there isn't a problem, but the moment I attempt to retrieve a document, I get an "Array to string conversion". I've simplified the document. This Array to string…
kemicofa ghost
  • 16,349
  • 8
  • 82
  • 131
1
vote
0 answers

Doctrine MongoDB ODM - bug with cascading executeUpsert

doctrine/mongodb-odm version 1.0.8 I have a document that uses self-referencing many to many bi-directional relationship. Ininitally I was getting errors telling me I must set up cascade=persist. I did that and now I am getting a very odd doctrine…
tgreiser
  • 393
  • 3
  • 13
1
vote
2 answers

Autocomplete filter in sonata admin mongodb

I have large collection of cities. I want in my admin to filter by city name. Because of large number of records i have to use sonata_type_model_autocomplete. It works almost perfect in form. $form->add('city',…
1
vote
0 answers

Error when persisting an embedded document with DoctrineMongoDB : array given

I'm working on a project using Doctrine-MongoDB and Symfony. I've embedded a document into an other using \@EmbedMany annotation. Here are the documents : MusicalInfos :
alex205
  • 11
  • 1
1
vote
2 answers

Zend Framework 2 Doctrine MongoDB ODM and Apache too slow

We're experiencing strange performance issues running: Zend Framework 2.3.3 on PHP 5.5.18-1 Doctrine MongoDB ODM Module (https://github.com/doctrine/mongodb, https://github.com/doctrine/DoctrineMongoODMModule) Ubuntu 12.04 on VirtualBox via Vagrant…
1
vote
0 answers

How to customize configureDatagridFilters in Sonata Admin to use non related mongodb documents

In my Mongodb I got a passenger document, this is a typical item: { "_id" : ObjectId("51efdf818d6b408449000002"), "createdAt" : 1374674817, "phone" : "222222", .. } I also have a device document that references a passenger document,…
abbood
  • 23,101
  • 16
  • 132
  • 246
1
vote
1 answer

doctrine:mongodb:fixtures:load removes created indexes

I am using Symfony 2 with the Doctrine Mongodb ODM, and trying to create some indexes that work together with the fixtures I have already created and am trying to load with php -f app/console doctrine:mongodb:fixtures:load When I create indexes…
Paul Weber
  • 6,518
  • 3
  • 43
  • 52
1
vote
1 answer

Mongodb Subdocument Date Range Returns Wrong Results

first time in Stackoverflow. I'm trying to run a date range query on an array collection but Mongo Shell returning irrelevant documents witch doesn't match my criteria. It doesn't matter i'm doing the query trough PHP drivers, Doctrine Mongodb…
Ugur
  • 1,679
  • 14
  • 20
1
vote
1 answer

How can I set a default value in Doctrinemongodb document?

How can I set the default value in field. In my document I need to set default value false for field emailnotify In mogodb th default value should be zero. Check my document namespace xxx\xxxBundle\Document; use FOS\UserBundle\Document\User as…
Lal Mohan
  • 323
  • 1
  • 7
  • 21
1
vote
2 answers

Querying discriminated collection by ID using Doctrine MongoDB

How can I query for an object knowing only its ObjectId using Doctrine MongoDB? Queries by id, using $dm->findOneBy(array('id' => $id)) will only return a result for one of the discriminated document types, but not others. Querying via the command…
Sean Quinn
  • 2,131
  • 1
  • 18
  • 48