Annotation Type ShardKey


  • @Documented
    @Retention(RUNTIME)
    @Target(ANNOTATION_TYPE)
    @MorphiaExperimental
    public @interface ShardKey
    Defines a shard key of a particular type
    Since:
    2.3
    Developer note.
    This is an experimental item. Its function and presence are subject to change. Feedback on features and usability extremely welcome.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value
      The shard key value
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      ShardKeyType type
      The type of sharding to use.
    • Element Detail

      • value

        String value
        The shard key value
        Returns:
        the shard key
      • type

        ShardKeyType type
        The type of sharding to use.
        Returns:
        the type
        Default:
        dev.morphia.mapping.ShardKeyType.RANGED