Which mapping type to choose for associative Arrays? Doctrine ODM

前端 未结 5 2320
深忆病人
深忆病人 2021-02-13 23:45

I have a simple question about the (by the way really great!) Doctrine ODM.

Assume you have a document like:

/**
 * @Document
 */
class Test
{
    /** @I         


        
5条回答
  •  暖寄归人
    2021-02-14 00:23

    I think you're looking for hash data type. Aren't you?

    use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
    
    /**
     * @Document
     */
    class Test
    {
        /** @Id */
        public $id;
    
        /**
         * @MongoDB\Field(type="hash")
        */
        public $field;
    }
    

提交回复
热议问题