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.client.gridfs.model.GridFSFile |
createFile(InputStream content,
String filename,
org.bson.Document 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 |
existDatabase(String name) |
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,
boolean returnId) |
Iterable<com.mongodb.client.gridfs.model.GridFSFile> |
findFiles(org.bson.Document query) |
Iterable<org.bson.Document> |
findObjects(String collection,
org.bson.Document query,
List<String> fields,
Integer numToSkip,
Integer limit,
org.bson.Document sortBy) |
Iterable<org.bson.Document> |
findObjects(String collection,
org.bson.Document query,
List<String> fields,
Integer numToSkip,
Integer limit,
org.bson.Document sortBy,
boolean returnId) |
com.mongodb.client.gridfs.model.GridFSFile |
findOneFile(org.bson.Document query) |
org.bson.Document |
findOneObject(String collection,
org.bson.Document query,
List<String> fields,
boolean failOnNotFound,
boolean returnId) |
com.mongodb.client.MongoCollection<org.bson.Document> |
getCollection(String name) |
String |
getConnectionId() |
com.mongodb.client.MongoDatabase |
getDatabase(String databaseName) |
InputStream |
getFileContent(org.bson.types.ObjectId id) |
String |
insertObject(String collection,
org.bson.Document document) |
org.bson.Document |
insertObjects(String collection,
List<org.bson.Document> documents,
boolean ordered) |
boolean |
isAlive() |
Iterable<String> |
listCollections() |
Iterable<com.mongodb.client.gridfs.model.GridFSFile> |
listFiles(org.bson.Document query) |
Collection<org.bson.Document> |
listIndices(String collection) |
Iterable<org.bson.Document> |
mapReduceObjects(String collection,
String mapFunction,
String reduceFunction,
String outputCollection) |
void |
removeFiles(org.bson.BsonObjectId id) |
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 existDatabase(@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, @NotNull org.bson.Document query, List<String> fields, Integer numToSkip, Integer limit, org.bson.Document sortBy)
Iterable<org.bson.Document> findObjects(@NotNull String collection, org.bson.Document query, List<String> fields, Integer numToSkip, Integer limit, org.bson.Document sortBy, boolean returnId)
org.bson.Document findOneObject(@NotNull String collection, org.bson.Document query, List<String> fields, boolean failOnNotFound, boolean returnId)
void createIndex(String collection, String field, IndexOrder order)
Collection<org.bson.Document> listIndices(String collection)
com.mongodb.client.gridfs.model.GridFSFile createFile(@NotNull InputStream content, @NotNull String filename, org.bson.Document metadata)
Iterable<com.mongodb.client.gridfs.model.GridFSFile> findFiles(@NotNull org.bson.Document query)
com.mongodb.client.gridfs.model.GridFSFile findOneFile(@NotNull org.bson.Document 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, boolean returnId)
InputStream getFileContent(@NotNull org.bson.types.ObjectId id)
Iterable<com.mongodb.client.gridfs.model.GridFSFile> listFiles(org.bson.Document query)
void removeFiles(org.bson.BsonObjectId id)
org.bson.Document executeCommand(org.bson.Document command)
void dropDatabase()
com.mongodb.client.MongoDatabase getDatabase(String databaseName)
boolean isAlive()
String getConnectionId()
org.bson.Document insertObjects(String collection, List<org.bson.Document> documents, boolean ordered)
Copyright © 2010–2019. All rights reserved.