Symfony中Doctrine对应的Mongodb数据类型 data type

时间:2014-03-06 10:26:16   收藏:0   阅读:678

1. hash 就是 json对象

2. collection 就是 数组

 

3. 若要知道如何使用referenceOne, referenceMany, embbedDocument等

主要查看:

http://doctrine-mongodb-odm.readthedocs.org/en/latest/reference/reference-mapping.html

http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/embedded-mapping.html#embed-many
http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/basic-mapping.html#doctrine-mapping-types
以上部分主要看yaml部分,就会知道如何编写 yml 了。
http://doctrine-mongodb-odm.readthedocs.org/en/latest/reference/basic-mapping.html
 
 
HasLifecycleCallbacks事件:
http://doctrine-mongodb-odm.readthedocs.org/en/latest/reference/annotations-reference.html
 
了解更多:
http://us.php.net/manual/zh/class.mongodbref.php
 
 
 
比较典型的yml:
 
Documents\User:
  fields:
    id:
      type: id
      id: true
    name:
      type: string
    email:
      type: string
  referenceMany:
    posts:
      targetDocument: Documents\BlogPost
      cascade: all

Documents\BlogPost:
  fields:
    id:
      type: id
      id: true
    title:
      type: string
    body:
      type: string
    createdAt:
      type: date
 

Symfony中Doctrine对应的Mongodb数据类型 data type,布布扣,bubuko.com

原文:http://www.cnblogs.com/vincedotnet/p/3583683.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!