public interface MongoClient extends Closeable
Modifier and Type | Method and Description |
---|---|
org.bson.Document |
addUser(String username,
String password) |
long |
countObjects(String collection,
org.bson.conversions.Bson query) |
void |
createCollection(String name,
boolean capped,
Integer maxObjects,
Integer size) |
com.mongodb.DBObject |
createFile(InputStream content,
String filename,
String contentType,
com.mongodb.DBObject metadata) |
void |
createIndex(String collection,
String field,
IndexOrder order) |
void |
dropCollection(String name) |
void |
dropDatabase() |
void |
dropIndex(String collection,
String name) |
org.bson.Document |
executeCommand(org.bson.Document command) |
boolean |
existsCollection(String name) |
org.bson.Document |
findAndUpdateObject(String collection,
org.bson.Document query,
org.bson.Document update,
List<String> fields,
boolean returnNew,
org.bson.Document sortBy,
boolean remove,
boolean upsert,
boolean bypassDocumentValidation) |
Iterable<com.mongodb.DBObject> |
findFiles(com.mongodb.DBObject query) |
Iterable<org.bson.Document> |
findObjects(String collection,
org.bson.Document query,
List<String> fields,
Integer numToSkip,
Integer limit,
org.bson.Document sortBy) |
com.mongodb.DBObject |
findOneFile(com.mongodb.DBObject query) |
org.bson.Document |
findOneObject(String collection,
org.bson.Document query,
List<String> fields,
boolean failOnNotFound) |
com.mongodb.client.MongoCollection<org.bson.Document> |
getCollection(String name) |
String |
getConnectionId() |
com.mongodb.client.MongoDatabase |
getDatabase(String databaseName) |
InputStream |
getFileContent(com.mongodb.DBObject query) |
String |
insertObject(String collection,
org.bson.Document document) |
boolean |
isAlive() |
Iterable<String> |
listCollections() |
Iterable<com.mongodb.DBObject> |
listFiles(com.mongodb.DBObject query) |
Collection<org.bson.Document> |
listIndices(String collection) |
Iterable<org.bson.Document> |
mapReduceObjects(String collection,
String mapFunction,
String reduceFunction,
String outputCollection) |
void |
removeFiles(com.mongodb.DBObject query) |
void |
removeObjects(String collection,
org.bson.conversions.Bson query) |
void |
saveObject(String collection,
org.bson.Document document) |
org.bson.Document |
updateObjects(String collection,
org.bson.Document query,
org.bson.Document object,
boolean multi,
boolean upsert) |
com.mongodb.client.MongoCollection<org.bson.Document> getCollection(@NotNull String name)
boolean existsCollection(@NotNull String name)
void dropCollection(@NotNull String name)
void createCollection(@NotNull String name, boolean capped, Integer maxObjects, Integer size)
org.bson.Document updateObjects(@NotNull String collection, org.bson.Document query, org.bson.Document object, boolean multi, boolean upsert)
void saveObject(@NotNull String collection, @NotNull org.bson.Document document)
void removeObjects(@NotNull String collection, org.bson.conversions.Bson query)
Iterable<org.bson.Document> mapReduceObjects(@NotNull String collection, @NotNull String mapFunction, @NotNull String reduceFunction, String outputCollection)
long countObjects(@NotNull String collection, org.bson.conversions.Bson query)
Iterable<org.bson.Document> findObjects(@NotNull String collection, org.bson.Document query, List<String> fields, Integer numToSkip, Integer limit, org.bson.Document sortBy)
org.bson.Document findOneObject(@NotNull String collection, org.bson.Document query, List<String> fields, boolean failOnNotFound)
void createIndex(String collection, String field, IndexOrder order)
Collection<org.bson.Document> listIndices(String collection)
com.mongodb.DBObject createFile(InputStream content, String filename, String contentType, com.mongodb.DBObject metadata)
Iterable<com.mongodb.DBObject> findFiles(com.mongodb.DBObject query)
com.mongodb.DBObject findOneFile(com.mongodb.DBObject query)
org.bson.Document findAndUpdateObject(@NotNull String collection, @NotNull org.bson.Document query, @NotNull org.bson.Document update, List<String> fields, boolean returnNew, org.bson.Document sortBy, boolean remove, boolean upsert, boolean bypassDocumentValidation)
InputStream getFileContent(com.mongodb.DBObject query)
Iterable<com.mongodb.DBObject> listFiles(com.mongodb.DBObject query)
void removeFiles(com.mongodb.DBObject query)
org.bson.Document executeCommand(org.bson.Document command)
void dropDatabase()
com.mongodb.client.MongoDatabase getDatabase(String databaseName)
boolean isAlive()
String getConnectionId()
Copyright © 2010–2016. All rights reserved.