Package | Description |
---|---|
com.mongodb |
The core mongodb package
|
com.mongodb.async.client |
This packages contains classes for the new async client
|
com.mongodb.async.client.gridfs |
Contains the classes for supporting MongoDB's specification for storing very large files, GridFS.
|
com.mongodb.client |
This package contains classes for the new client api for MongoDatabase and MongoCollection
|
com.mongodb.client.gridfs |
This package contains the new GridFS implementation
|
com.mongodb.internal.session | |
com.mongodb.operation |
The core of the MongoDB driver works via operations, using the command pattern.
|
Modifier and Type | Method and Description |
---|---|
ClientSession |
MongoClient.startSession(ClientSessionOptions options)
Creates a client session.
|
Modifier and Type | Method and Description |
---|---|
MongoIterable<String> |
MongoClient.listDatabaseNames(ClientSession clientSession)
Get a list of the database names
|
ListDatabasesIterable<Document> |
MongoClient.listDatabases(ClientSession clientSession)
Gets the list of databases
|
<T> ListDatabasesIterable<T> |
MongoClient.listDatabases(ClientSession clientSession,
Class<T> clazz)
Gets the list of databases
|
Modifier and Type | Method and Description |
---|---|
AggregateIterable<TDocument> |
MongoCollection.aggregate(ClientSession clientSession,
List<? extends Bson> pipeline)
Aggregates documents according to the specified aggregation pipeline.
|
<TResult> AggregateIterable<TResult> |
MongoCollection.aggregate(ClientSession clientSession,
List<? extends Bson> pipeline,
Class<TResult> resultClass)
Aggregates documents according to the specified aggregation pipeline.
|
void |
MongoCollection.bulkWrite(ClientSession clientSession,
List<? extends WriteModel<? extends TDocument>> requests,
BulkWriteOptions options,
SingleResultCallback<BulkWriteResult> callback)
Executes a mix of inserts, updates, replaces, and deletes.
|
void |
MongoCollection.bulkWrite(ClientSession clientSession,
List<? extends WriteModel<? extends TDocument>> requests,
SingleResultCallback<BulkWriteResult> callback)
Executes a mix of inserts, updates, replaces, and deletes.
|
void |
MongoCollection.count(ClientSession clientSession,
Bson filter,
CountOptions options,
SingleResultCallback<Long> callback)
Counts the number of documents in the collection according to the given options.
|
void |
MongoCollection.count(ClientSession clientSession,
Bson filter,
SingleResultCallback<Long> callback)
Counts the number of documents in the collection according to the given options.
|
void |
MongoCollection.count(ClientSession clientSession,
SingleResultCallback<Long> callback)
Counts the number of documents in the collection.
|
void |
MongoDatabase.createCollection(ClientSession clientSession,
String collectionName,
CreateCollectionOptions options,
SingleResultCallback<Void> callback)
Create a new collection with the selected options
|
void |
MongoDatabase.createCollection(ClientSession clientSession,
String collectionName,
SingleResultCallback<Void> callback)
Create a new collection with the given name.
|
void |
MongoCollection.createIndex(ClientSession clientSession,
Bson key,
IndexOptions options,
SingleResultCallback<String> callback)
Creates an index.
|
void |
MongoCollection.createIndex(ClientSession clientSession,
Bson key,
SingleResultCallback<String> callback)
Creates an index.
|
void |
MongoCollection.createIndexes(ClientSession clientSession,
List<IndexModel> indexes,
CreateIndexOptions createIndexOptions,
SingleResultCallback<List<String>> callback)
Create multiple indexes.
|
void |
MongoCollection.createIndexes(ClientSession clientSession,
List<IndexModel> indexes,
SingleResultCallback<List<String>> callback)
Create multiple indexes.
|
void |
MongoDatabase.createView(ClientSession clientSession,
String viewName,
String viewOn,
List<? extends Bson> pipeline,
CreateViewOptions createViewOptions,
SingleResultCallback<Void> callback)
Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.
|
void |
MongoDatabase.createView(ClientSession clientSession,
String viewName,
String viewOn,
List<? extends Bson> pipeline,
SingleResultCallback<Void> callback)
Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.
|
void |
MongoCollection.deleteMany(ClientSession clientSession,
Bson filter,
DeleteOptions options,
SingleResultCallback<DeleteResult> callback)
Removes all documents from the collection that match the given query filter.
|
void |
MongoCollection.deleteMany(ClientSession clientSession,
Bson filter,
SingleResultCallback<DeleteResult> callback)
Removes all documents from the collection that match the given query filter.
|
void |
MongoCollection.deleteOne(ClientSession clientSession,
Bson filter,
DeleteOptions options,
SingleResultCallback<DeleteResult> callback)
Removes at most one document from the collection that matches the given filter.
|
void |
MongoCollection.deleteOne(ClientSession clientSession,
Bson filter,
SingleResultCallback<DeleteResult> callback)
Removes at most one document from the collection that matches the given filter.
|
<TResult> DistinctIterable<TResult> |
MongoCollection.distinct(ClientSession clientSession,
String fieldName,
Bson filter,
Class<TResult> resultClass)
Gets the distinct values of the specified field name.
|
<TResult> DistinctIterable<TResult> |
MongoCollection.distinct(ClientSession clientSession,
String fieldName,
Class<TResult> resultClass)
Gets the distinct values of the specified field name.
|
void |
MongoCollection.drop(ClientSession clientSession,
SingleResultCallback<Void> callback)
Drops this collection from the Database.
|
void |
MongoDatabase.drop(ClientSession clientSession,
SingleResultCallback<Void> callback)
Drops this database.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
Bson keys,
DropIndexOptions dropIndexOptions,
SingleResultCallback<Void> callback)
Drops the index given the keys used to create it.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
Bson keys,
SingleResultCallback<Void> callback)
Drops the index given the keys used to create it.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
String indexName,
DropIndexOptions dropIndexOptions,
SingleResultCallback<Void> callback)
Drops the index given its name.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
String indexName,
SingleResultCallback<Void> callback)
Drops the index given its name.
|
void |
MongoCollection.dropIndexes(ClientSession clientSession,
DropIndexOptions dropIndexOptions,
SingleResultCallback<Void> callback)
Drop all the indexes on this collection, except for the default on _id.
|
void |
MongoCollection.dropIndexes(ClientSession clientSession,
SingleResultCallback<Void> callback)
Drop all the indexes on this collection, except for the default on _id.
|
FindIterable<TDocument> |
MongoCollection.find(ClientSession clientSession)
Finds all documents in the collection.
|
FindIterable<TDocument> |
MongoCollection.find(ClientSession clientSession,
Bson filter)
Finds all documents in the collection.
|
<TResult> FindIterable<TResult> |
MongoCollection.find(ClientSession clientSession,
Bson filter,
Class<TResult> resultClass)
Finds all documents in the collection.
|
<TResult> FindIterable<TResult> |
MongoCollection.find(ClientSession clientSession,
Class<TResult> resultClass)
Finds all documents in the collection.
|
void |
MongoCollection.findOneAndDelete(ClientSession clientSession,
Bson filter,
FindOneAndDeleteOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and remove it.
|
void |
MongoCollection.findOneAndDelete(ClientSession clientSession,
Bson filter,
SingleResultCallback<TDocument> callback)
Atomically find a document and remove it.
|
void |
MongoCollection.findOneAndReplace(ClientSession clientSession,
Bson filter,
TDocument replacement,
FindOneAndReplaceOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and replace it.
|
void |
MongoCollection.findOneAndReplace(ClientSession clientSession,
Bson filter,
TDocument replacement,
SingleResultCallback<TDocument> callback)
Atomically find a document and replace it.
|
void |
MongoCollection.findOneAndUpdate(ClientSession clientSession,
Bson filter,
Bson update,
FindOneAndUpdateOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and update it.
|
void |
MongoCollection.findOneAndUpdate(ClientSession clientSession,
Bson filter,
Bson update,
SingleResultCallback<TDocument> callback)
Atomically find a document and update it.
|
void |
MongoCollection.insertMany(ClientSession clientSession,
List<? extends TDocument> documents,
InsertManyOptions options,
SingleResultCallback<Void> callback)
Inserts one or more documents.
|
void |
MongoCollection.insertMany(ClientSession clientSession,
List<? extends TDocument> documents,
SingleResultCallback<Void> callback)
Inserts one or more documents.
|
void |
MongoCollection.insertOne(ClientSession clientSession,
TDocument document,
InsertOneOptions options,
SingleResultCallback<Void> callback)
Inserts the provided document.
|
void |
MongoCollection.insertOne(ClientSession clientSession,
TDocument document,
SingleResultCallback<Void> callback)
Inserts the provided document.
|
MongoIterable<String> |
MongoDatabase.listCollectionNames(ClientSession clientSession)
Gets the names of all the collections in this database.
|
ListCollectionsIterable<Document> |
MongoDatabase.listCollections(ClientSession clientSession)
Finds all the collections in this database.
|
<TResult> ListCollectionsIterable<TResult> |
MongoDatabase.listCollections(ClientSession clientSession,
Class<TResult> resultClass)
Finds all the collections in this database.
|
MongoIterable<String> |
MongoClient.listDatabaseNames(ClientSession clientSession)
Get a list of the database names
|
ListDatabasesIterable<Document> |
MongoClient.listDatabases(ClientSession clientSession)
Gets the list of databases
|
<TResult> ListDatabasesIterable<TResult> |
MongoClient.listDatabases(ClientSession clientSession,
Class<TResult> resultClass)
Gets the list of databases
|
ListIndexesIterable<Document> |
MongoCollection.listIndexes(ClientSession clientSession)
Get all the indexes in this collection.
|
<TResult> ListIndexesIterable<TResult> |
MongoCollection.listIndexes(ClientSession clientSession,
Class<TResult> resultClass)
Get all the indexes in this collection.
|
MapReduceIterable<TDocument> |
MongoCollection.mapReduce(ClientSession clientSession,
String mapFunction,
String reduceFunction)
Aggregates documents according to the specified map-reduce function.
|
<TResult> MapReduceIterable<TResult> |
MongoCollection.mapReduce(ClientSession clientSession,
String mapFunction,
String reduceFunction,
Class<TResult> resultClass)
Aggregates documents according to the specified map-reduce function.
|
void |
MongoCollection.renameCollection(ClientSession clientSession,
MongoNamespace newCollectionNamespace,
RenameCollectionOptions options,
SingleResultCallback<Void> callback)
Rename the collection with oldCollectionName to the newCollectionName.
|
void |
MongoCollection.renameCollection(ClientSession clientSession,
MongoNamespace newCollectionNamespace,
SingleResultCallback<Void> callback)
Rename the collection with oldCollectionName to the newCollectionName.
|
void |
MongoCollection.replaceOne(ClientSession clientSession,
Bson filter,
TDocument replacement,
SingleResultCallback<UpdateResult> callback)
Replace a document in the collection according to the specified arguments.
|
void |
MongoCollection.replaceOne(ClientSession clientSession,
Bson filter,
TDocument replacement,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Replace a document in the collection according to the specified arguments.
|
<TResult> void |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command,
Class<TResult> resultClass,
SingleResultCallback<TResult> callback)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
<TResult> void |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command,
ReadPreference readPreference,
Class<TResult> resultClass,
SingleResultCallback<TResult> callback)
Executes the given command in the context of the current database with the given read preference.
|
void |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command,
ReadPreference readPreference,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with the given read preference.
|
void |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
void |
MongoCollection.updateMany(ClientSession clientSession,
Bson filter,
Bson update,
SingleResultCallback<UpdateResult> callback)
Update all documents in the collection according to the specified arguments.
|
void |
MongoCollection.updateMany(ClientSession clientSession,
Bson filter,
Bson update,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Update all documents in the collection according to the specified arguments.
|
void |
MongoCollection.updateOne(ClientSession clientSession,
Bson filter,
Bson update,
SingleResultCallback<UpdateResult> callback)
Update a single document in the collection according to the specified arguments.
|
void |
MongoCollection.updateOne(ClientSession clientSession,
Bson filter,
Bson update,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Update a single document in the collection according to the specified arguments.
|
ChangeStreamIterable<TDocument> |
MongoCollection.watch(ClientSession clientSession)
Creates a change stream for this collection.
|
<TResult> ChangeStreamIterable<TResult> |
MongoCollection.watch(ClientSession clientSession,
Class<TResult> resultClass)
Creates a change stream for this collection.
|
ChangeStreamIterable<TDocument> |
MongoCollection.watch(ClientSession clientSession,
List<? extends Bson> pipeline)
Creates a change stream for this collection.
|
<TResult> ChangeStreamIterable<TResult> |
MongoCollection.watch(ClientSession clientSession,
List<? extends Bson> pipeline,
Class<TResult> resultClass)
Creates a change stream for this collection.
|
Modifier and Type | Method and Description |
---|---|
void |
MongoClient.startSession(ClientSessionOptions options,
SingleResultCallback<ClientSession> callback)
Creates a client session.
|
Modifier and Type | Method and Description |
---|---|
void |
GridFSBucket.delete(ClientSession clientSession,
BsonValue id,
SingleResultCallback<Void> callback)
Given a
id , delete this stored file's files collection document and associated chunks from a GridFS bucket. |
void |
GridFSBucket.delete(ClientSession clientSession,
ObjectId id,
SingleResultCallback<Void> callback)
Given a
id , delete this stored file's files collection document and associated chunks from a GridFS bucket. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
BsonValue id,
AsyncOutputStream destination,
SingleResultCallback<Long> callback)
Downloads the contents of the stored file specified by
id and writes the contents to the destination
AsyncOutputStream. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
ObjectId id,
AsyncOutputStream destination,
SingleResultCallback<Long> callback)
Downloads the contents of the stored file specified by
id and writes the contents to the destination
AsyncOutputStream. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
String filename,
AsyncOutputStream destination,
GridFSDownloadOptions options,
SingleResultCallback<Long> callback)
Downloads the contents of the stored file specified by
filename and by the revision in options and writes the
contents to the destination Stream. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
String filename,
AsyncOutputStream destination,
SingleResultCallback<Long> callback)
Downloads the contents of the latest version of the stored file specified by
filename and writes the contents to
the destination Stream. |
void |
GridFSBucket.drop(ClientSession clientSession,
SingleResultCallback<Void> callback)
Drops the data associated with this bucket from the database.
|
GridFSFindIterable |
GridFSBucket.find(ClientSession clientSession)
Finds all documents in the files collection.
|
GridFSFindIterable |
GridFSBucket.find(ClientSession clientSession,
Bson filter)
Finds all documents in the collection that match the filter.
|
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
BsonValue id)
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by
id . |
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
ObjectId id)
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by
id . |
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
String filename)
Opens a Stream from which the application can read the contents of the latest version of the stored file specified by the
filename . |
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
String filename,
GridFSDownloadOptions options)
Opens a Stream from which the application can read the contents of the stored file specified by
filename and the revision
in options . |
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
BsonValue id,
String filename)
Opens a AsyncOutputStream that the application can write the contents of the file to.
|
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
BsonValue id,
String filename,
GridFSUploadOptions options)
Opens a AsyncOutputStream that the application can write the contents of the file to.
|
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
String filename)
Opens a AsyncOutputStream that the application can write the contents of the file to.
|
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
String filename,
GridFSUploadOptions options)
Opens a AsyncOutputStream that the application can write the contents of the file to.
|
void |
GridFSBucket.rename(ClientSession clientSession,
BsonValue id,
String newFilename,
SingleResultCallback<Void> callback)
Renames the stored file with the specified
id . |
void |
GridFSBucket.rename(ClientSession clientSession,
ObjectId id,
String newFilename,
SingleResultCallback<Void> callback)
Renames the stored file with the specified
id . |
void |
GridFSBucket.uploadFromStream(ClientSession clientSession,
BsonValue id,
String filename,
AsyncInputStream source,
GridFSUploadOptions options,
SingleResultCallback<Void> callback)
Uploads the contents of the given
AsyncInputStream to a GridFS bucket. |
void |
GridFSBucket.uploadFromStream(ClientSession clientSession,
BsonValue id,
String filename,
AsyncInputStream source,
SingleResultCallback<Void> callback)
Uploads the contents of the given
AsyncInputStream to a GridFS bucket. |
void |
GridFSBucket.uploadFromStream(ClientSession clientSession,
String filename,
AsyncInputStream source,
GridFSUploadOptions options,
SingleResultCallback<ObjectId> callback)
Uploads the contents of the given
AsyncInputStream to a GridFS bucket. |
void |
GridFSBucket.uploadFromStream(ClientSession clientSession,
String filename,
AsyncInputStream source,
SingleResultCallback<ObjectId> callback)
Uploads the contents of the given
AsyncInputStream to a GridFS bucket. |
Modifier and Type | Method and Description |
---|---|
AggregateIterable<TDocument> |
MongoCollection.aggregate(ClientSession clientSession,
List<? extends Bson> pipeline)
Aggregates documents according to the specified aggregation pipeline.
|
<TResult> AggregateIterable<TResult> |
MongoCollection.aggregate(ClientSession clientSession,
List<? extends Bson> pipeline,
Class<TResult> resultClass)
Aggregates documents according to the specified aggregation pipeline.
|
BulkWriteResult |
MongoCollection.bulkWrite(ClientSession clientSession,
List<? extends WriteModel<? extends TDocument>> requests)
Executes a mix of inserts, updates, replaces, and deletes.
|
BulkWriteResult |
MongoCollection.bulkWrite(ClientSession clientSession,
List<? extends WriteModel<? extends TDocument>> requests,
BulkWriteOptions options)
Executes a mix of inserts, updates, replaces, and deletes.
|
long |
MongoCollection.count(ClientSession clientSession)
Counts the number of documents in the collection.
|
long |
MongoCollection.count(ClientSession clientSession,
Bson filter)
Counts the number of documents in the collection according to the given options.
|
long |
MongoCollection.count(ClientSession clientSession,
Bson filter,
CountOptions options)
Counts the number of documents in the collection according to the given options.
|
void |
MongoDatabase.createCollection(ClientSession clientSession,
String collectionName)
Create a new collection with the given name.
|
void |
MongoDatabase.createCollection(ClientSession clientSession,
String collectionName,
CreateCollectionOptions createCollectionOptions)
Create a new collection with the selected options
|
String |
MongoCollection.createIndex(ClientSession clientSession,
Bson keys)
Create an index with the given keys.
|
String |
MongoCollection.createIndex(ClientSession clientSession,
Bson keys,
IndexOptions indexOptions)
Create an index with the given keys and options.
|
List<String> |
MongoCollection.createIndexes(ClientSession clientSession,
List<IndexModel> indexes)
Create multiple indexes.
|
List<String> |
MongoCollection.createIndexes(ClientSession clientSession,
List<IndexModel> indexes,
CreateIndexOptions createIndexOptions)
Create multiple indexes.
|
void |
MongoDatabase.createView(ClientSession clientSession,
String viewName,
String viewOn,
List<? extends Bson> pipeline)
Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.
|
void |
MongoDatabase.createView(ClientSession clientSession,
String viewName,
String viewOn,
List<? extends Bson> pipeline,
CreateViewOptions createViewOptions)
Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.
|
DeleteResult |
MongoCollection.deleteMany(ClientSession clientSession,
Bson filter)
Removes all documents from the collection that match the given query filter.
|
DeleteResult |
MongoCollection.deleteMany(ClientSession clientSession,
Bson filter,
DeleteOptions options)
Removes all documents from the collection that match the given query filter.
|
DeleteResult |
MongoCollection.deleteOne(ClientSession clientSession,
Bson filter)
Removes at most one document from the collection that matches the given filter.
|
DeleteResult |
MongoCollection.deleteOne(ClientSession clientSession,
Bson filter,
DeleteOptions options)
Removes at most one document from the collection that matches the given filter.
|
<TResult> DistinctIterable<TResult> |
MongoCollection.distinct(ClientSession clientSession,
String fieldName,
Bson filter,
Class<TResult> resultClass)
Gets the distinct values of the specified field name.
|
<TResult> DistinctIterable<TResult> |
MongoCollection.distinct(ClientSession clientSession,
String fieldName,
Class<TResult> resultClass)
Gets the distinct values of the specified field name.
|
void |
MongoCollection.drop(ClientSession clientSession)
Drops this collection from the Database.
|
void |
MongoDatabase.drop(ClientSession clientSession)
Drops this database.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
Bson keys)
Drops the index given the keys used to create it.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
Bson keys,
DropIndexOptions dropIndexOptions)
Drops the index given the keys used to create it.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
String indexName)
Drops the index given its name.
|
void |
MongoCollection.dropIndex(ClientSession clientSession,
String indexName,
DropIndexOptions dropIndexOptions)
Drops the index given its name.
|
void |
MongoCollection.dropIndexes(ClientSession clientSession)
Drop all the indexes on this collection, except for the default on _id.
|
void |
MongoCollection.dropIndexes(ClientSession clientSession,
DropIndexOptions dropIndexOptions)
Drop all the indexes on this collection, except for the default on _id.
|
FindIterable<TDocument> |
MongoCollection.find(ClientSession clientSession)
Finds all documents in the collection.
|
FindIterable<TDocument> |
MongoCollection.find(ClientSession clientSession,
Bson filter)
Finds all documents in the collection.
|
<TResult> FindIterable<TResult> |
MongoCollection.find(ClientSession clientSession,
Bson filter,
Class<TResult> resultClass)
Finds all documents in the collection.
|
<TResult> FindIterable<TResult> |
MongoCollection.find(ClientSession clientSession,
Class<TResult> resultClass)
Finds all documents in the collection.
|
TDocument |
MongoCollection.findOneAndDelete(ClientSession clientSession,
Bson filter)
Atomically find a document and remove it.
|
TDocument |
MongoCollection.findOneAndDelete(ClientSession clientSession,
Bson filter,
FindOneAndDeleteOptions options)
Atomically find a document and remove it.
|
TDocument |
MongoCollection.findOneAndReplace(ClientSession clientSession,
Bson filter,
TDocument replacement)
Atomically find a document and replace it.
|
TDocument |
MongoCollection.findOneAndReplace(ClientSession clientSession,
Bson filter,
TDocument replacement,
FindOneAndReplaceOptions options)
Atomically find a document and replace it.
|
TDocument |
MongoCollection.findOneAndUpdate(ClientSession clientSession,
Bson filter,
Bson update)
Atomically find a document and update it.
|
TDocument |
MongoCollection.findOneAndUpdate(ClientSession clientSession,
Bson filter,
Bson update,
FindOneAndUpdateOptions options)
Atomically find a document and update it.
|
void |
MongoCollection.insertMany(ClientSession clientSession,
List<? extends TDocument> documents)
Inserts one or more documents.
|
void |
MongoCollection.insertMany(ClientSession clientSession,
List<? extends TDocument> documents,
InsertManyOptions options)
Inserts one or more documents.
|
void |
MongoCollection.insertOne(ClientSession clientSession,
TDocument document)
Inserts the provided document.
|
void |
MongoCollection.insertOne(ClientSession clientSession,
TDocument document,
InsertOneOptions options)
Inserts the provided document.
|
MongoIterable<String> |
MongoDatabase.listCollectionNames(ClientSession clientSession)
Gets the names of all the collections in this database.
|
ListCollectionsIterable<Document> |
MongoDatabase.listCollections(ClientSession clientSession)
Finds all the collections in this database.
|
<TResult> ListCollectionsIterable<TResult> |
MongoDatabase.listCollections(ClientSession clientSession,
Class<TResult> resultClass)
Finds all the collections in this database.
|
ListIndexesIterable<Document> |
MongoCollection.listIndexes(ClientSession clientSession)
Get all the indexes in this collection.
|
<TResult> ListIndexesIterable<TResult> |
MongoCollection.listIndexes(ClientSession clientSession,
Class<TResult> resultClass)
Get all the indexes in this collection.
|
MapReduceIterable<TDocument> |
MongoCollection.mapReduce(ClientSession clientSession,
String mapFunction,
String reduceFunction)
Aggregates documents according to the specified map-reduce function.
|
<TResult> MapReduceIterable<TResult> |
MongoCollection.mapReduce(ClientSession clientSession,
String mapFunction,
String reduceFunction,
Class<TResult> resultClass)
Aggregates documents according to the specified map-reduce function.
|
void |
MongoCollection.renameCollection(ClientSession clientSession,
MongoNamespace newCollectionNamespace)
Rename the collection with oldCollectionName to the newCollectionName.
|
void |
MongoCollection.renameCollection(ClientSession clientSession,
MongoNamespace newCollectionNamespace,
RenameCollectionOptions renameCollectionOptions)
Rename the collection with oldCollectionName to the newCollectionName.
|
UpdateResult |
MongoCollection.replaceOne(ClientSession clientSession,
Bson filter,
TDocument replacement)
Replace a document in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.replaceOne(ClientSession clientSession,
Bson filter,
TDocument replacement,
UpdateOptions updateOptions)
Replace a document in the collection according to the specified arguments.
|
Document |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
<TResult> TResult |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command,
Class<TResult> resultClass)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
Document |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command,
ReadPreference readPreference)
Executes the given command in the context of the current database with the given read preference.
|
<TResult> TResult |
MongoDatabase.runCommand(ClientSession clientSession,
Bson command,
ReadPreference readPreference,
Class<TResult> resultClass)
Executes the given command in the context of the current database with the given read preference.
|
UpdateResult |
MongoCollection.updateMany(ClientSession clientSession,
Bson filter,
Bson update)
Update all documents in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.updateMany(ClientSession clientSession,
Bson filter,
Bson update,
UpdateOptions updateOptions)
Update all documents in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.updateOne(ClientSession clientSession,
Bson filter,
Bson update)
Update a single document in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.updateOne(ClientSession clientSession,
Bson filter,
Bson update,
UpdateOptions updateOptions)
Update a single document in the collection according to the specified arguments.
|
ChangeStreamIterable<TDocument> |
MongoCollection.watch(ClientSession clientSession)
Creates a change stream for this collection.
|
<TResult> ChangeStreamIterable<TResult> |
MongoCollection.watch(ClientSession clientSession,
Class<TResult> resultClass)
Creates a change stream for this collection.
|
ChangeStreamIterable<TDocument> |
MongoCollection.watch(ClientSession clientSession,
List<? extends Bson> pipeline)
Creates a change stream for this collection.
|
<TResult> ChangeStreamIterable<TResult> |
MongoCollection.watch(ClientSession clientSession,
List<? extends Bson> pipeline,
Class<TResult> resultClass)
Creates a change stream for this collection.
|
Modifier and Type | Method and Description |
---|---|
void |
GridFSBucket.delete(ClientSession clientSession,
BsonValue id)
Given a
id , delete this stored file's files collection document and associated chunks from a GridFS bucket. |
void |
GridFSBucket.delete(ClientSession clientSession,
ObjectId id)
Given a
id , delete this stored file's files collection document and associated chunks from a GridFS bucket. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
BsonValue id,
OutputStream destination)
Downloads the contents of the stored file specified by
id and writes the contents to the destination Stream. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
ObjectId id,
OutputStream destination)
Downloads the contents of the stored file specified by
id and writes the contents to the destination Stream. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
String filename,
OutputStream destination)
Downloads the contents of the latest version of the stored file specified by
filename and writes the contents to
the destination Stream. |
void |
GridFSBucket.downloadToStream(ClientSession clientSession,
String filename,
OutputStream destination,
GridFSDownloadOptions options)
Downloads the contents of the stored file specified by
filename and by the revision in options and writes the
contents to the destination Stream. |
void |
GridFSBucket.drop(ClientSession clientSession)
Drops the data associated with this bucket from the database.
|
GridFSFindIterable |
GridFSBucket.find(ClientSession clientSession)
Finds all documents in the files collection.
|
GridFSFindIterable |
GridFSBucket.find(ClientSession clientSession,
Bson filter)
Finds all documents in the collection that match the filter.
|
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
BsonValue id)
Opens a Stream from which the application can read the contents of the stored file specified by
id . |
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
ObjectId id)
Opens a Stream from which the application can read the contents of the stored file specified by
id . |
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
String filename)
Opens a Stream from which the application can read the contents of the latest version of the stored file specified by the
filename . |
GridFSDownloadStream |
GridFSBucket.openDownloadStream(ClientSession clientSession,
String filename,
GridFSDownloadOptions options)
Opens a Stream from which the application can read the contents of the stored file specified by
filename and the revision
in options . |
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
BsonValue id,
String filename)
Opens a Stream that the application can write the contents of the file to.
|
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
BsonValue id,
String filename,
GridFSUploadOptions options)
Opens a Stream that the application can write the contents of the file to.
|
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
ObjectId id,
String filename)
Opens a Stream that the application can write the contents of the file to.
|
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
String filename)
Opens a Stream that the application can write the contents of the file to.
|
GridFSUploadStream |
GridFSBucket.openUploadStream(ClientSession clientSession,
String filename,
GridFSUploadOptions options)
Opens a Stream that the application can write the contents of the file to.
|
void |
GridFSBucket.rename(ClientSession clientSession,
BsonValue id,
String newFilename)
Renames the stored file with the specified
id . |
void |
GridFSBucket.rename(ClientSession clientSession,
ObjectId id,
String newFilename)
Renames the stored file with the specified
id . |
void |
GridFSBucket.uploadFromStream(ClientSession clientSession,
BsonValue id,
String filename,
InputStream source)
Uploads the contents of the given
InputStream to a GridFS bucket. |
void |
GridFSBucket.uploadFromStream(ClientSession clientSession,
BsonValue id,
String filename,
InputStream source,
GridFSUploadOptions options)
Uploads the contents of the given
InputStream to a GridFS bucket. |
ObjectId |
GridFSBucket.uploadFromStream(ClientSession clientSession,
String filename,
InputStream source)
Uploads the contents of the given
InputStream to a GridFS bucket. |
ObjectId |
GridFSBucket.uploadFromStream(ClientSession clientSession,
String filename,
InputStream source,
GridFSUploadOptions options)
Uploads the contents of the given
InputStream to a GridFS bucket. |
Modifier and Type | Class and Description |
---|---|
class |
ClientSessionImpl |
Modifier and Type | Method and Description |
---|---|
ClientSession |
ClientSessionContext.getClientSession() |
Constructor and Description |
---|
ClientSessionContext(ClientSession clientSession) |
Modifier and Type | Method and Description |
---|---|
<T> void |
AsyncOperationExecutor.execute(AsyncReadOperation<T> operation,
ReadPreference readPreference,
ClientSession session,
SingleResultCallback<T> callback)
Execute the read operation with the given read preference.
|
<T> void |
AsyncOperationExecutor.execute(AsyncWriteOperation<T> operation,
ClientSession session,
SingleResultCallback<T> callback)
Execute the write operation.
|
Copyright © 2018. All rights reserved.