Object Document Mapper Is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object-relational mapping, although some programmers opt to create their own ODM tools.
Questions tagged [odm]
218 questions
2
votes
2 answers
Need Symfony 2 MongoDB bundle which uses MongoDB.so extention
I am facing issue in production which has mongodb.so extention where our Symfony 2 ODM bundle is using mongo.so.
And also as mentioned in following reference link mongo.so is deprecated hence we don't want to use mongo.so further.…

Aravind Kumar Anugula
- 1,304
- 3
- 14
- 35
2
votes
1 answer
MongoDB/RethinkDB Use ODM or not?
I am building a boilerplate app in koajs for later use. I cannot decide if I should use an ODM or not. I can define my schemas using ES6 classes and even if I use something like mongoose I will probably end up writing a lot of custom validators so…

Utku Turunç
- 334
- 1
- 7
2
votes
0 answers
Doctrine ODM : PersistentCollection::toArray returns empty array
Here's a definition of the field for the main document:
/**
* @var ArrayCollection
* @MongoDB\ReferenceMany(
* targetDocument="Some\Namespace\Document\Reference",
* sort={"creationDate": "desc"},
* simple=true
* )
* @Expose
*…

Kamil Zając
- 253
- 1
- 3
- 7
2
votes
1 answer
ODM Query Builder: Is there an "inverse in" operator, or equivalent operation?
In my synfony 2 project, I'm filtering search results using a query builder. In my MongoDB i have some values in an array.
Query Bulider has the "in" operator that allows to query for values that equal one of many in an array. I wanted to perform…

ecc
- 1,490
- 1
- 17
- 42
2
votes
1 answer
Creating/persisting new document while preUpdate event in doctrine-mongodb
I'm using doctrine-mongodb-odm-1.0.0-BETA10 and trying to provide some custom logic based on \InitialDocument while preUpdate event running.
Lets say \InitialDocument obtained some state which must behave as initial one for new \StateDocument. I'm…

lazycommit
- 414
- 5
- 18
2
votes
1 answer
Doctrine ODM: How to select Mongo DB database
I use doctrine ODM to persist and load documents from my Mongo DB. I followed this guide: https://doctrine-mongodb-odm.readthedocs.org/en/latest/tutorials/getting-started.html
Following this guide all documents get stored in the database "doctrine"…

tester
- 3,977
- 5
- 39
- 59
2
votes
1 answer
AND and OR expression in Doctrine ODM
I need to transform a SQL request into a DQL request :
SELECT * FROM object WHERE stardate >= GETDATE() AND enddate <= GETDATE() OR stardate >= GETDATE() AND enddate IS NULL
I tried with :
$now = new \DateTime();
$qb = $this->createQueryBuilder()
…

Cyril F
- 1,247
- 3
- 16
- 31
2
votes
1 answer
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 $email;
/**
* @ODM\String
*/
protected…

ABS
- 2,626
- 3
- 28
- 44
2
votes
0 answers
How do we create a Schema at runtime in Mongoose ODM?
It's my understanding that Mongoose Schema's are defined at some point in the initiating stages of a Node app. These will obviously be hard coded, like so:
var SomeSchema = new Schema({
some_string:String,
some_number:Number
});
If I'm…

shennan
- 10,798
- 5
- 44
- 79
2
votes
1 answer
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 Reference , ...
Is there a complete reference,cheat…

ABS
- 2,626
- 3
- 28
- 44
2
votes
1 answer
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, $type));
...which works fine. Now I see new data in mongo…

Krzysiek Gała
- 21
- 2
2
votes
1 answer
Atomicity of Model.create in Mongoose when passing an array of documents
So I understand that MongoDB (and by proxy Mongoose) does not support transactions, but that operations involving a single document are always atomic. In looking over the Mongoose docs, I ran into Model.create which allows one to pass an array of…

MCybertron
- 123
- 1
- 6
2
votes
1 answer
Motivations for using relational database / ORM or document database / ODM
It's been a long time since I haven't created a project from scratch, and now document-oriented databases (as well as ODM) have become quite popular, so I have to consider them before blindly going the relational route.
Could anyone try to list the…

BenMorel
- 34,448
- 50
- 182
- 322
2
votes
1 answer
How to specify the class for Doctrine ODM Collection mapping types
I have a document with a field marked for persistence as a Collection
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
/** @ODM\Document */
class Item
{
/**
* @ODM\Collection
*/
protected $things;
}
By default, when…

D-Rock
- 2,636
- 1
- 21
- 26
1
vote
0 answers
Query / Find a document by an Embedmany document's id in Doctrine ODM
.......
->createQueryBuilder( 'Model\Document\Post' )
->field( 'comments.id' )->equals( $commentId ) ....
Does not work, but when comments are ReferenceMany it works. Is such query not possible when EmbedMany relation
No need to mention 'comments'…

dahuda
- 13
- 4