Interface CollectionInstruction


  • public interface CollectionInstruction
    Represents a migration instruction set for NitriteCollection.
    Since:
    4.0
    Author:
    Anindya Chatterjee
    • Method Detail

      • addField

        default CollectionInstruction addField​(String fieldName)
        Adds an instruction to add new field to the documents of a NitriteCollection.
        Parameters:
        fieldName - the field name
        Returns:
        the collection instruction
      • addField

        default CollectionInstruction addField​(String fieldName,
                                               Object defaultValue)
        Adds an instruction to add new field with a default value, into the documents of a NitriteCollection.
        Parameters:
        fieldName - the field name
        defaultValue - the default value
        Returns:
        the collection instruction
      • addField

        default CollectionInstruction addField​(String fieldName,
                                               Generator<?> generator)
        Adds an instruction to add new field with value generator, into the document of a NitriteCollection.
        Parameters:
        fieldName - the field name
        generator - the generator
        Returns:
        the collection instruction
      • renameField

        default CollectionInstruction renameField​(String oldName,
                                                  String newName)
        Adds an instruction to rename a field to the document of a NitriteCollection.
        Parameters:
        oldName - the old name
        newName - the new name
        Returns:
        the collection instruction
      • deleteField

        default CollectionInstruction deleteField​(String fieldName)
        Adds an instruction to delete a field from the document of a NitriteCollection.
        Parameters:
        fieldName - the field name
        Returns:
        the collection instruction
      • dropIndex

        default CollectionInstruction dropIndex​(String... indexedFieldNames)
        Adds an instruction to drop an index from a NitriteCollection.
        Parameters:
        indexedFieldNames - the indexed field names
        Returns:
        the collection instruction
      • createIndex

        default CollectionInstruction createIndex​(String indexType,
                                                  String... fieldNames)
        Adds an instruction to create an index in a NitriteCollection.
        Parameters:
        fieldNames - the field names
        indexType - the index type
        Returns:
        the collection instruction
      • collectionName

        String collectionName()
        The name of the collection for this instruction.
        Returns:
        the name
      • addStep

        void addStep​(MigrationStep step)
        Adds a migration step to the instruction set.
        Parameters:
        step - the step