Which mapping type to choose for associative Arrays? Doctrine ODM -


i have simple question (by way great!) doctrine odm.

assume have document like:

/**  * @document  */ class test {     /** @id */     public $id;     /** @whichtype */     public $field = array(); } 

now want store associative array like

array("test" => "test1", "anothertest" => "test2", ......); 

in $field property of class.

no problem mongodb, know, in doctrine when use example @collection or @field, values stored (array_values being used in mapping driver collection example). stored value looks like

array("test1", "test2", ....) 

does know doctrine-odm mapping type should use in order preserve key-value pairs in database?

thank in advance,

andi (greetz germany)

it should hash type:

http://readthedocs.org/docs/doctrine-mongodb-odm/en/latest/reference/annotations-reference.html?highlight=hash#hash


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -