Class ArrayIndexConfiguration

java.lang.Object
com.couchbase.lite.IndexConfiguration
com.couchbase.lite.ArrayIndexConfiguration

public final class ArrayIndexConfiguration extends IndexConfiguration
Configuration for indexing property values within nested arrays in documents, intended for use with the UNNEST query.
  • Constructor Details

    • ArrayIndexConfiguration

      public ArrayIndexConfiguration(@NonNull String path)
      Initializes the configuration with paths to the nested array with no expressions constraining the values within the arrays to be indexed.
      Parameters:
      path - Path to the array, which can be nested to be indexed. Use "[]" to represent a property that is an array of each nested array level. For a single array or the last level array, the "[]" is optional. For instance, use "contacts[].phones" to specify an array of phones within each contact.
    • ArrayIndexConfiguration

      public ArrayIndexConfiguration(@NonNull String path, @NonNull String expression, @Nullable String... expressions)
      Initializes the configuration with paths to the nested array and the expressions for the values within the arrays to be indexed. A null expression will cause a runtime error.
      Parameters:
      path - Path to the array, which can be nested to be indexed. Use "[]" to represent a property that is an array of each nested array level. For a single array or the last level array, the "[]" is optional. For instance, use "contacts[].phones" to specify an array of phones within each contact.
      expressions - A list of strings, where each string represents an expression defining the values within the array to be indexed. Expressions may not be null.
    • ArrayIndexConfiguration

      public ArrayIndexConfiguration(@NonNull String path, @Nullable List<String> expressions)
      Initializes the configuration with paths to the nested array and the expressions for the values within the arrays to be indexed.
      Parameters:
      path - Path to the array, which can be nested to be indexed. Use "[]" to represent a property that is an array of each nested array level. For a single array or the last level array, the "[]" is optional. For instance, use "contacts[].phones" to specify an array of phones within each contact.
      expressions - An optional list of strings, where each string represents an expression defining the values within the array to be indexed. If the array specified by the path contains scalar values, this parameter can be null: see ArrayIndexConfiguration(String)
  • Method Details

    • getPath

      @NonNull public String getPath()
      Path to the array, which can be nested.