0
votes
1answer
19 views

MongoDbBundle how to access manager in an arbitray class

in Symfony2 samples I can find how to access mongodb in from the Controller class: $dm=$this->get('doctrine_mongodb')->getManager(); how to do it in an arbitray class?
0
votes
2answers
23 views

FOSUBUserProvider must implement UserProviderInterface

We are trying to use FOSUserBundle and HWIOAuthBundle together in the way like it's described there https://gist.github.com/danvbe/4476697 The only difference is that we are using mongodb. This ...
0
votes
0answers
8 views

Symfony 2 Sonata Admin date range filter on doctrine_mongo_date

I need to understand how to write a date range filter in sonata admin class using mongo db (for orm there is a date range filter already). How can I create this custom filter for Sonata? Any tips? I ...
0
votes
1answer
26 views

Error provide a default value

I'm trying to play with MongoDB. But I've got some problems. # src/Controller/DefaultController.php public function editCategoryAction(Category $category) { echo $category->getName(); ...
0
votes
1answer
34 views

Should a MongoDB SubDocument that's never stored directly be a Document or a plain PHP class?

I am creating a game where users can design their own levels (placing monsters, traps, quests etc.) I'm using Symfony 2.3, and chose MongoDB because it's got Doctrine support. When somebody edits a ...
1
vote
1answer
27 views

MongoException no documents given

I am using MongoDB in my symfony project. For communication to the database, i am using either Document Manager and MongoClient. What i intend to do is to batch insert an array directly into the ...
0
votes
1answer
34 views

Symfony 2 : use MongoDB as session storage

I have an application built on Symfony 2 using DoctrineORM / MySQL to store data and PdoSessionHandler / MySQL to store sessions. I am trying to replace DoctrineORM to DoctrineODM to use MongoDB ...
0
votes
0answers
22 views

After updating Bundle doctrine / mongodb-ODM to update fields in a document type EmbeddedMany

Good afternoon. I have a problem after updating Bundle doctrine / mongodb-ODM to update fields in a document type Embeddedmany. class Parameter { //...... /** * ...
0
votes
0answers
19 views

MongoDB With Symfony2

I have to make an auto suggest on city level so that i have list cities of mapped with respective countries like USA => ( "New York", "Dallas", "Los Angeles" .....) what i need is to save it in ...
0
votes
0answers
13 views

doctrine does not abstract mysql and mongodb simple queries

Why is it not possible to execute mysql or mongodb queries without changing query? I thought doctrine made it possible, but in fact it does not.(or else I am using doctrine in a wrong way) Let's say ...
0
votes
3answers
109 views

Sylius installation aborts

I want to try out sylius but I have the following problems with installation : php composer.phar create-project sylius/sylius -s dev /wamp/www/sylius2 Error message : Installing dependencies ...
2
votes
2answers
117 views

How to map mongo documents with subdocuments in symfony2

I'm trying to create symfony2 application which will access mongoDB collection with the following structure: { "_id": ObjectId("5239c1c0359bf908058a5071"), "param2": "test", "param3": { ...
0
votes
1answer
74 views

Sonata Admin - Injecting securityContext into Admin class

I need to write the name of logged user in some fields of my model (I've got a parent document and some embedded documents) I've injected security context in my admin class calls: - [ ...
1
vote
1answer
55 views

Symfony2 - Forced to validate inside DataTransformer because of type hint on setter

I have created an Object to ID Data Transformer. It's part of a custom ObjectIdType that allows me to enter the ID of a document instead of using a 'document' form type. It's handy for MongoDB (when ...
0
votes
1answer
29 views

Reference null in MongoDB

I am trying to put a reference to null but I can not. taking this: /** * @MongoDB\ReferenceOne(targetDocument="alumn", simple=true, nullable=true) */ protected $alumn; Can someone tell me how to ...
0
votes
0answers
49 views

How to get the type of MongoDB Document in twig?

I used Symfony2 and Doctrine MongoDBBundle and I have simple Single Collection Inheritance classes. How can I know what type of document it is in a twig template? For example the base class is Entity ...
1
vote
0answers
86 views

JMSSerializerBundle, MongoDB, and XML Metadata

I've been wracking my brain over this all night it seems. Every time I try to serialize the results from a document query, I receive a result of bool(false). Presumably this means that the ...
0
votes
0answers
59 views

Symfony / MongoDB -> checking if relation exists gives a true response as it's false

I'm working on a Symfony 2 project in which I have to link files and folders in many relations via doctrine ODM (mongodb). In my documents i've already set like this for both File & Folder ...
3
votes
1answer
94 views

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": [{ ...
0
votes
0answers
38 views

Using openId via FpOpenIdBundle without FOSUserBundle

I want to use OpenId with FpOpenIdBundle and my database is MongoDB. As i read in here,we must have an extra entity in DB like Identity, in addition User entity(document). The question is can we use ...
0
votes
1answer
66 views

Setting TTL for collection using Doctrine MongoDB ODM

Since MongoDB 2.2 it is possible to "Expire Data from Collections Using a TTL" which is implemented as a special index type. The latest version of Doctrine ORM supports this Index Option. ...
1
vote
1answer
129 views

How to get difference between two Dates in Symfony MongoDB?

I have a problem with calculate dates difference between a PHP date object and current time.I know that i must get current time with this: //in a symfony controller new \DateTime("now") and i have ...
2
votes
1answer
66 views

Forms in Symfony2 MongoDB

I have this class for member : class Member { /** * @ODM\Id */ protected $id; /** * @ODM\String */ protected $fName; /** * @ODM\String */ protected $lName; /** * @ODM\String */ protected ...
0
votes
0answers
88 views

Symfony2 unique constraint with multiple fields and mongodb

I've started working with Symfony2 and MongoDB (Doctrine ODM) and am having difficulty getting the unique validator constraint to work on multiple fields (one field references another MongoDB document ...
0
votes
2answers
69 views

Page cannot be charged because of mongodb errors Symfony 2

After i made a clear cache i refreshed my page, but this time the browser looks like he doesn't find nothing or he is somewhere blocked, because it shows up near the address that he is searching or ...
0
votes
1answer
66 views

Using authentification with DoctrineMongoDBBundle

I need your help, pls. I'm currently working on a project where I use mongodb as database, and I began with no security in my mongo configuration of the symfony config.yml. This is what my ...
0
votes
1answer
79 views

Doctrine MongoDB ODM do not change state of referenced object

I'm Using Symfony2 with the DoctrineMongoDB Bundle. I made a service that receives Informations in JSON Format (Objects). The Object I'm sending got a property for referencing to another Object in a ...
0
votes
0answers
40 views

doctrine2 mongodb full text search

How to realize a query like this (full text search): db.myDoc.runCommand( "text", { search: "Olivia" } ); in Symfony2 and Doctrine2?
0
votes
2answers
437 views

Trying to install MongoDBBundle For Symfony. using composer but it can not be resolved

Anthonys-MacBook-Air:activebook numerical25$ php composer.phar update PHP Warning: Module 'openssl' already loaded in Unknown on line 0 Warning: Module 'openssl' already loaded in Unknown on line 0 ...
2
votes
1answer
47 views

ODM Annotation : What is “strategy” attribute?

What is strategy attribute in @EmbedOne annotation? And what is the difference between its values? set , pushAll I not find any good explain in references about Annotation in ODM,like Annotations ...
2
votes
1answer
52 views

DoctrineMongoDB : How to create classes from database?

It's possible to generate database from classes that have writeen by this command doctrine:mongodb:schema:create Is there any way to do this inversely? I mean generate classes from database?
2
votes
1answer
100 views

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 , ...
0
votes
1answer
54 views

Get empty collection of embedded documents

I want to get a collection of embedded documents. I put data into the database like this: $dm->getRepository('BundleUserBundle:User')->addRatedPostById($user->getId(), new RatedPost($id, ...
0
votes
1answer
115 views

Symfony2,Doctrine,MongoDb: Unable to pass query result to view

I'm trying to work my way through the DoctrineMongoDBBundle tutorial in the Symfony documentation book. I have created the test "Products" collection, and am able to insert into it without any ...
0
votes
0answers
31 views

searching for a way to filter results by a field defined in another linked table using Doctrine and MongoDB

I need to find a way to filter results from a MongoDB database, based on fields found in the current table, and a field found in another table which is linked to the current table. Tables format: { ...
1
vote
2answers
197 views

sharing objects between doctrine2 odm and orm in symfony2 with doctrine extensions

in my project i need to share objects between orm and odm. I have an entity "Variation" and a document "Tracking". One variation can hold many trackingevents. I tried to solve it through doctrine ...
0
votes
1answer
82 views

Issue with createQueryBuilder and MongoRegex

After several research for the createquerybuilder for mongodb, I cannot solve my issue.Can you please help me? Here is the structure of the data : “Field1” : { “Field2”: “value1a”,“Field3” : ...
2
votes
1answer
101 views

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

Reference a Embed Document in Doctrine2 and MongoDB

I have a document User that contains /** * @MongoDB\ReferenceOne(targetDocument="Image") */ private $image; and a document ImageCollection which embed documents called Image /** * ...
0
votes
0answers
64 views

Get a specific value in array Mongodb and Symfony 2

I have a field ‘preferences’ in my Document, and datas like this: {"visibility":"true","create":"2013-06-15 15:09:51","update":1371301791} {"visibility":"false","create":"2013-06-15 ...
0
votes
0answers
56 views

DoctrineExtensions - Timestampable for Documents are not working

I ve implemented https://github.com/l3pp4rd/DoctrineExtensions in my sf2.3 projekt and all extensions are working pretty good for ORM. But i am using ODM in the same application. The Problem is, that ...
1
vote
1answer
141 views

Symfony2 and MongoDB Annotations / Mapping not recognized

I followed the steps descriped in the cookbook. But when i run doctrine:mapping:info or doctrine:generate:entities doctrine ignores my file. Here is the code, maybe someone has an advice. ...
0
votes
0answers
247 views

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 ...
1
vote
2answers
179 views

FosUserBundle don't persist datas in mongodb database

I use symfony2 and the mongoDb ODM. Today I have installed FosUserBundle. My User class is like that : use FOS\UserBundle\Document\User as BaseUser; use Doctrine\Common\Collections\ArrayCollection; ...
1
vote
0answers
153 views

Silex , mongo DB and updating a Document , Unique Constraint validation doesnt work properly

I'm testing silex, mongodb and Form validation. And I run into a validation issue when using MongoDB ODM and a before middelware , wether it is security related or not. I'm given a document and have ...
0
votes
0answers
33 views

How to remove an Embed Document from an Embed Document?

I'm currently working on a project with Symfony 2 and MongoDB and I'm facing a problem while removing an Embed Document using is ID. I'm working with Activities. An Activity embed a list of Comment ...
0
votes
1answer
476 views

Lazy load between referenced documents on MongoDB with Doctrine ODM

Helo, firstly, please excuse my English, is not very good. I am migrating the data container of a Symfony2 application to MongoDB, before that it run with MySQL. I added the DoctrineMongoDBBundle ...
1
vote
0answers
133 views

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 ...
2
votes
2answers
2k views

FOSRestBundle and JMS Serializer, error when geting JSON

I have been trying out Symfony 2.2, the FOSRest Bundle (using JMS Serializer), and Doctrine ODM using MongoDB. After many hours of trying to figure out how to correctly setup the FOSRest Bundle I'm ...
0
votes
1answer
95 views

How to query mongodb with condition “like” in symfony2

I need to search the users in my symfony2 app If a user enter an alphabet in search box and submit then he need to get the users starting with that alphabet. How to achieve this? Below code will ...

15 30 50 per page