public interface MongoDatabase
get
a MongoCollection
.Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_NAME
The name of the administration database.
|
static String |
CONFIG_NAME
The name of the configuration database for a sharded configuration.
|
static String |
LOCAL_NAME
The name of the local database.
|
static String |
TEST_NAME
The name of the test database.
|
Modifier and Type | Method and Description |
---|---|
boolean |
drop()
Drops the database.
|
MongoCollection |
getCollection(String name)
Returns the MongoCollection with the specified name.
|
String |
getName()
Returns the name of the database.
|
List<String> |
listCollections()
Returns the list of the collections contained within the database.
|
Document |
runAdminCommand(String command)
Runs an administrative command against the 'admin' database.
|
Document |
runAdminCommand(String command,
DocumentAssignable options)
Runs an administrative command against the 'admin' database.
|
Document |
runAdminCommand(String commandName,
String commandValue,
DocumentAssignable options)
Runs an administrative command against the 'admin' database.
|
Document |
runCommand(String command)
Runs a command against the database.
|
Document |
runCommand(String command,
DocumentAssignable options)
Runs a command against the database.
|
Document |
runCommand(String commandName,
String commandValue,
DocumentAssignable options)
Runs a command against the database.
|
void |
runCommandAsync(Callback<Document> reply,
String command)
Runs a command against the database.
|
void |
runCommandAsync(Callback<Document> reply,
String command,
DocumentAssignable options)
Runs a command against the database.
|
void |
runCommandAsync(Callback<Document> reply,
String commandName,
String commandValue,
DocumentAssignable options)
Runs a command against the database.
|
Future<Document> |
runCommandAsync(String command)
Runs a command against the database.
|
Future<Document> |
runCommandAsync(String command,
DocumentAssignable options)
Runs a command against the database.
|
Future<Document> |
runCommandAsync(String commandName,
String commandValue,
DocumentAssignable options)
Runs a command against the database.
|
static final String ADMIN_NAME
static final String CONFIG_NAME
static final String LOCAL_NAME
static final String TEST_NAME
boolean drop() throws MongoDbException
MongoDbException
- On an error issuing the drop command or in running the
commandMongoCollection getCollection(String name)
name
- The name of the collection.MongoCollection
.String getName()
List<String> listCollections() throws MongoDbException
MongoDbException
- On an error listing the collections.Document runAdminCommand(String command) throws MongoDbException
command
- The name of the command to run.MongoDbException
- On an error issuing the command or in running the commandDocument runAdminCommand(String command, DocumentAssignable options) throws MongoDbException
command
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandDocument runAdminCommand(String commandName, String commandValue, DocumentAssignable options) throws MongoDbException
commandName
- The name of the command to run.commandValue
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandDocument runCommand(String command) throws MongoDbException
command
- The name of the command to run.MongoDbException
- On an error issuing the command or in running the commandDocument runCommand(String command, DocumentAssignable options) throws MongoDbException
command
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandDocument runCommand(String commandName, String commandValue, DocumentAssignable options) throws MongoDbException
commandName
- The name of the command to run.commandValue
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandvoid runCommandAsync(Callback<Document> reply, String command) throws MongoDbException
reply
- Callback
that will be notified of the command results.command
- The name of the command to run.MongoDbException
- On an error issuing the command or in running the commandvoid runCommandAsync(Callback<Document> reply, String command, DocumentAssignable options) throws MongoDbException
reply
- Callback
that will be notified of the command results.command
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandvoid runCommandAsync(Callback<Document> reply, String commandName, String commandValue, DocumentAssignable options) throws MongoDbException
reply
- Callback
that will be notified of the command results.commandName
- The name of the command to run.commandValue
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandFuture<Document> runCommandAsync(String command) throws MongoDbException
command
- The name of the command to run.MongoDbException
- On an error issuing the command or in running the commandFuture<Document> runCommandAsync(String command, DocumentAssignable options) throws MongoDbException
command
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandFuture<Document> runCommandAsync(String commandName, String commandValue, DocumentAssignable options) throws MongoDbException
commandName
- The name of the command to run.commandValue
- The name of the command to run.options
- Optional (may be null) options for the command.MongoDbException
- On an error issuing the command or in running the commandCopyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.