       reviewers: [@ReferenceField Person, [username: 1]]
       subdocument:
         person: @ReferenceField Person, ['username'], false
+        slug: @GeneratedField 'self', ['body', 'subdocument.body'], (fields) ->
+          if _.isUndefined(fields.body) or _.isUndefined(fields.subdocument?.body)
+            [fields._id, undefined]
+          else if _.isNull(fields.body) or _.isNull(fields.subdocument.body)
+            [fields._id, null]
+          else
+            [fields._id, "subdocument-prefix-#{ fields.body.toLowerCase() }-#{ fields.subdocument.body.toLowerCase() }-suffix"]
       nested: [
         required: @ReferenceField Person, ['username']
         optional: @ReferenceField Person, ['username'], false
+        slug: @GeneratedField 'self', ['body', 'nested.body'], (fields) ->
+          if _.isUndefined(fields.body) or _.isUndefined(fields.subdocument?.body)
+            [fields._id, undefined]
+          else if _.isNull(fields.body) or _.isNull(fields.subdocument.body)
+            [fields._id, null]
+          else
+            [fields._id, "nested-prefix-#{ fields.body.toLowerCase() }-#{ fields.nested.body.toLowerCase() }-suffix"]
       ]
       slug: @GeneratedField 'self', ['body', 'subdocument.body'], (fields) ->
         if _.isUndefined(fields.body) or _.isUndefined(fields.subdocument?.body)

      subdocument:
        person: null
        persons: []
        body: 'SubdocumentFooBar'
      nested: []
      body: 'FooBar'
      slug: 'prefix-foobar-subdocumentfoobar-suffix'

    Persons.remove @person1Id,
      expect (error) =>

          [fields._id, null]
        else
          [fields._id, "prefix-#{ fields.body.toLowerCase() }-#{ fields.subdocument.body.toLowerCase() }-suffix"]
      tags: @GeneratedField 'self', ['body', 'subdocument.body', 'nested.body'], (fields) ->
        tags = []
        if fields.body and fields.subdocument?.body
          tags.push "tag-#{ tags.length }-#{ fields.body.toLowerCase() }-#{ fields.subdocument.body.toLowerCase() }-suffix"
        if fields.body and fields.nested and _.isArray fields.nested
          for nested in fields.nested
            tags.push "tag-#{ tags.length }-#{ fields.body.toLowerCase() }-#{ nested.body.toLowerCase() }-suffix"
        [fields._id, tags]

# To test MixinMeta when initial Meta is delayed
class Post extends Post
