Annotation Interface Document


@Inherited @Retention(RUNTIME) @Target(TYPE) public @interface Document
Identifies a domain object to be persisted to MongoDB.
Author:
Jon Brisbin, Oliver Gierke, Christoph Strobl
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Defines the collation to apply when executing a query or creating indexes.
    The collection the document representing the entity is supposed to be stored in.
    Defines the default language to be used with this document.
    The collection the document representing the entity is supposed to be stored in.
  • Element Details

    • value

      @AliasFor("collection") String value
      The collection the document representing the entity is supposed to be stored in. If not configured, a default collection name will be derived from the type's name. The attribute supports SpEL expressions to dynamically calculate the collection to based on a per operation basis.
      Returns:
      the name of the collection to be used.
      Default:
      ""
    • collection

      @AliasFor("value") String collection
      The collection the document representing the entity is supposed to be stored in. If not configured, a default collection name will be derived from the type's name. The attribute supports SpEL expressions to dynamically calculate the collection to based on a per operation basis.
      Returns:
      the name of the collection to be used.
      Default:
      ""
    • language

      String language
      Defines the default language to be used with this document.
      Returns:
      an empty String by default.
      Since:
      1.6
      Default:
      ""
    • collation

      Defines the collation to apply when executing a query or creating indexes.
      Returns:
      an empty String by default.
      Since:
      2.2
      Default:
      ""