TestDocuments\User:
  db: documents
  collection: user
  fields:
    id:
      fieldName: id
      id: true
    username:
      fieldName: username
      type: string
      unique: true
      sparse: true
    createdAt:
      fieldName: createdAt
      type: date
    tags:
      type: collection
  embedOne:
    address:
      targetDocument: Documents\Address
    test:
      targetDocument: TestDocuments\EmbeddedDocument
  embedMany:
    phonenumbers:
      targetDocument: Documents\Phonenumber
  referenceOne:
    profile:
      simple: true
      targetDocument: Documents\Profile
      cascade: all
      orphanRemoval: true
    account:
      targetDocument: Documents\Account
      cascade: all
  referenceMany:
    groups:
      targetDocument: Documents\Group
      cascade: all
  lifecycleCallbacks:
    prePersist: [doStuffOnPrePersist]
    postPersist: [doStuffOnPostPersist, doOtherStuffOnPostPersist]
  alsoLoadMethods:
    doStuffOnAlsoLoad: unmappedField

