           if fields.body and fields.subdocument?.body
             tags.push "tag-#{ tags.length }-prefix-#{ fields.body.toLowerCase() }-#{ fields.subdocument.body.toLowerCase() }-suffix"
           if fields.body and fields.nested and _.isArray fields.nested
-            for nested in fields.nested
+            for nested in fields.nested when nested.body
               tags.push "tag-#{ tags.length }-prefix-#{ fields.body.toLowerCase() }-#{ nested.body.toLowerCase() }-suffix"
           [fields._id, tags]
       ]

          _id: @person3._id
          username: @person3.username
        ]
        slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
        body: 'SubdocumentFooBar'
      nested: [
        required:
          _id: @person3._id
          username: @person3.username
        optional: null
        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
        body: 'NestedFooBar'
      ,
        required:
          _id: @person3._id
          username: @person3.username
        optional: null
        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
        body: 'NestedFooBar'
      ,
        required:
          _id: @person3._id
          username: @person3.username
        optional:
          _id: @person3._id
          username: @person3.username
        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
        body: 'NestedFooBar'
      ]
      body: 'FooBar'
      slug: 'prefix-foobar-subdocumentfoobar-suffix'
      tags: [
        'tag-0-prefix-foobar-subdocumentfoobar-suffix'
        'tag-1-prefix-foobar-nestedfoobar-suffix'
        'tag-2-prefix-foobar-nestedfoobar-suffix'
        'tag-3-prefix-foobar-nestedfoobar-suffix'
      ]

    Persons.remove @person3Id,

        'tag-6-prefix-foobar-nestedfoobar-suffix'
      ]

    Posts.update @postId,
      $set:
        'subdocument.body': 'SubdocumentFooBarZ'
    ,
      expect (error, res) =>
        test.isFalse error, error?.toString?() or error
        test.isTrue res

    # Sleep so that observers have time to update documents
    Meteor.setTimeout expect(), 500
