EctoTablestore.Migration.secondary_index

You're seeing just the function secondary_index, go back to EctoTablestore.Migration module for more information.
Link to this function

secondary_index(table_name, index_name, opts \\ [])

View Source

Returns a secondary index struct that can be given to create/2.

For more information see the Chinese Docs | English Docs

Examples

create secondary_index("posts", "posts_owner") do
  add_pk(:owner_id)
  add_pk(:id)
  add_column(:title)
  add_column(:content)
end

Options

  • :include_base_data, specifies whether the index table includes the existing data in the base table, if set it to true means the index includes the existing data, if set it to false means the index excludes the existing data, optional, by default it is true.