Package org.dizitart.no2.migration
Interface CollectionInstruction
-
public interface CollectionInstructionRepresents a migration instruction set forNitriteCollection.- Since:
- 4.0
- Author:
- Anindya Chatterjee
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CollectionInstructionaddField(String fieldName)Adds an instruction to add new field to the documents of aNitriteCollection.default CollectionInstructionaddField(String fieldName, Object defaultValue)Adds an instruction to add new field with a default value, into the documents of aNitriteCollection.default CollectionInstructionaddField(String fieldName, Generator<?> generator)Adds an instruction to add new field with value generator, into the document of aNitriteCollection.voidaddStep(MigrationStep step)Adds a migration step to the instruction set.StringcollectionName()The name of the collection for this instruction.default CollectionInstructioncreateIndex(String indexType, String... fieldNames)Adds an instruction to create an index in aNitriteCollection.default CollectionInstructiondeleteField(String fieldName)Adds an instruction to delete a field from the document of aNitriteCollection.default CollectionInstructiondropAllIndices()Adds an instruction to drop all indices from aNitriteCollection.default CollectionInstructiondropIndex(String... indexedFieldNames)Adds an instruction to drop an index from aNitriteCollection.default CollectionInstructionrename(String name)Adds an instruction to rename aNitriteCollection.default CollectionInstructionrenameField(String oldName, String newName)Adds an instruction to rename a field to the document of aNitriteCollection.
-
-
-
Method Detail
-
rename
default CollectionInstruction rename(String name)
Adds an instruction to rename aNitriteCollection.- Parameters:
name- the name- Returns:
- the instruction
-
addField
default CollectionInstruction addField(String fieldName)
Adds an instruction to add new field to the documents of aNitriteCollection.- 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 aNitriteCollection.- Parameters:
fieldName- the field namedefaultValue- 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 aNitriteCollection.- Parameters:
fieldName- the field namegenerator- 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 aNitriteCollection.- Parameters:
oldName- the old namenewName- the new name- Returns:
- the collection instruction
-
deleteField
default CollectionInstruction deleteField(String fieldName)
Adds an instruction to delete a field from the document of aNitriteCollection.- Parameters:
fieldName- the field name- Returns:
- the collection instruction
-
dropIndex
default CollectionInstruction dropIndex(String... indexedFieldNames)
Adds an instruction to drop an index from aNitriteCollection.- Parameters:
indexedFieldNames- the indexed field names- Returns:
- the collection instruction
-
dropAllIndices
default CollectionInstruction dropAllIndices()
Adds an instruction to drop all indices from aNitriteCollection.- Returns:
- the collection instruction
-
createIndex
default CollectionInstruction createIndex(String indexType, String... fieldNames)
Adds an instruction to create an index in aNitriteCollection.- Parameters:
fieldNames- the field namesindexType- 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
-
-