1. hash 就是 json对象

2. collection 就是 数组

 

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

主要查看:

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

以上部分主要看yaml部分,就会知道如何编写 yml 了。
 
 
HasLifecycleCallbacks事件:
 
了解更多:
 
 
 
比较典型的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
 

相关文章:

  • 2021-10-08
  • 2021-11-28
  • 2021-09-08
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案