public class CreateIndexCommand extends Command
createIndexes
command easier.Modifier and Type | Field and Description |
---|---|
static Version |
REQUIRED_VERSION
The first version of MongoDB to support the
createIndexes
command. |
static VersionRange |
REQUIRED_VERSION_RANGE
The required server version range for the
createIndexes command. |
COMMAND_COLLECTION
HEADER_SIZE, myCollectionName, myDatabaseName
Constructor and Description |
---|
CreateIndexCommand(String databaseName,
String collectionName,
Element[] keys,
String indexName,
DocumentAssignable options)
Create a new CreateIndexCommand.
|
Modifier and Type | Method and Description |
---|---|
static String |
buildIndexName(Element... keys)
Generates a name for the index based on the keys.
|
boolean |
equals(Object object)
Determines if the passed object is of this same type as this object and
if so that its fields are equal.
|
int |
hashCode()
Computes a reasonable hash code.
|
getCommand, getOperationName, getRoutingDocument, isAllowJumbo, setAllowJumbo, size, toString, validateSize, write, write
finishHeader, getCollectionName, getDatabaseName, getReadPreference, getRequiredVersionRange, init, writeHeader, writeHeader
public static final Version REQUIRED_VERSION
createIndexes
command.public static final VersionRange REQUIRED_VERSION_RANGE
createIndexes
command.public CreateIndexCommand(String databaseName, String collectionName, Element[] keys, String indexName, DocumentAssignable options)
databaseName
- The name of the database.collectionName
- The name of the collection the command is using. This should
be the real collection and not
$cmd
.keys
- The index keys for the index.indexName
- The name of the index.options
- Options for the index. May be null
.public static String buildIndexName(Element... keys)
keys
- The keys for the index.public boolean equals(Object object)
equals
in class Command
object
- The object to compare to.Object.equals(java.lang.Object)
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.