Meta

Adds the specified metadata to each input document.

Usage

  • Meta(params IModule[] modules)

    The specified modules are executed against an empty initial document and all metadata that exist in all of the result documents are added as metadata to each input document.

    • modules

      The modules to execute.

  • Meta(string key, ContextConfig metadata)

    Uses a function to determine an object to be added as metadata for each document. This allows you to specify different metadata for each document depending on the context.

    • key

      The metadata key to set.

    • metadata

      A delegate that returns the object to add as metadata.

  • Meta(string key, DocumentConfig metadata)

    Uses a function to determine an object to be added as metadata for each document. This allows you to specify different metadata for each document depending on the input.

    • key

      The metadata key to set.

    • metadata

      A delegate that returns the object to add as metadata.

  • Meta(string key, Object metadata)

    The specified object is added as metadata for the specified key for every input document.

    • key

      The metadata key to set.

    • metadata

      The object to add as metadata.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • ForEachDocument(bool forEachDocument = true)

    Specifies that the whole sequence of modules should be executed for every input document (as opposed to the default behavior of the sequence of modules only being executed once with an empty initial document). This method has no effect if no modules are specified.

    • forEachDocument

      true to execute for every input document.

  • IgnoreNull(bool ignoreNull = true)

    Ignores null values and does not add a metadata item for them.

    • ignoreNull

      true to ignore null values.

  • OnlyIfNonExisting(bool onlyIfNonExisting = true)

    Only sets the new metadata value if a value doesn't already exist. The default behavior is to set the new value regardless.

    • onlyIfNonExisting

      true if the new value should only be set if it doesn't already exist.

GitHub