Package org.dizitart.no2.migration
Interface CollectionInstruction
public interface CollectionInstruction
Represents a migration instruction set for
NitriteCollection.- Since:
- 4.0
- Author:
- Anindya Chatterjee
-
Method Summary
Modifier and TypeMethodDescriptiondefault CollectionInstructionAdds an instruction to add new field to the documents of aNitriteCollection.default CollectionInstructionAdds an instruction to add new field with a default value, into the documents of aNitriteCollection.default CollectionInstructionAdds 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.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 CollectionInstructionAdds an instruction to drop all indices from aNitriteCollection.default CollectionInstructionAdds an instruction to drop an index from aNitriteCollection.default CollectionInstructionAdds an instruction to rename aNitriteCollection.default CollectionInstructionrenameField(String oldName, String newName) Adds an instruction to rename a field to the document of aNitriteCollection.
-
Method Details
-
rename
Adds an instruction to rename aNitriteCollection.- Parameters:
name- the name- Returns:
- the instruction
-
addField
Adds an instruction to add new field to the documents of aNitriteCollection.- Parameters:
fieldName- the field name- Returns:
- the collection instruction
-
addField
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
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
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
Adds an instruction to delete a field from the document of aNitriteCollection.- Parameters:
fieldName- the field name- Returns:
- the collection instruction
-
dropIndex
Adds an instruction to drop an index from aNitriteCollection.- Parameters:
indexedFieldNames- the indexed field names- Returns:
- the collection instruction
-
dropAllIndices
Adds an instruction to drop all indices from aNitriteCollection.- Returns:
- the collection instruction
-
createIndex
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
Adds a migration step to the instruction set.- Parameters:
step- the step
-