Package io.vertx.mongo.client
Interface MongoDatabase
-
public interface MongoDatabaseThe MongoDatabase interface.Note: Additions to this interface will not be considered to break binary compatibility.
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MongoCollectionResult<JsonObject>aggregate(JsonArray pipeline)Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.MongoCollectionResult<JsonObject>aggregate(JsonArray pipeline, AggregateOptions options)Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.MongoCollectionResult<JsonObject>aggregate(ClientSession clientSession, JsonArray pipeline)Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.MongoCollectionResult<JsonObject>aggregate(ClientSession clientSession, JsonArray pipeline, AggregateOptions options)Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.Future<java.lang.Void>createCollection(ClientSession clientSession, java.lang.String collectionName)Create a new collection with the given name.voidcreateCollection(ClientSession clientSession, java.lang.String collectionName, Handler<AsyncResult<java.lang.Void>> resultHandler)Create a new collection with the given name.Future<java.lang.Void>createCollection(ClientSession clientSession, java.lang.String collectionName, CreateCollectionOptions options)Create a new collection with the selected optionsvoidcreateCollection(ClientSession clientSession, java.lang.String collectionName, CreateCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)Create a new collection with the selected optionsFuture<java.lang.Void>createCollection(java.lang.String collectionName)Create a new collection with the given name.voidcreateCollection(java.lang.String collectionName, Handler<AsyncResult<java.lang.Void>> resultHandler)Create a new collection with the given name.Future<java.lang.Void>createCollection(java.lang.String collectionName, CreateCollectionOptions options)Create a new collection with the selected optionsvoidcreateCollection(java.lang.String collectionName, CreateCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)Create a new collection with the selected optionsFuture<java.lang.Void>createView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline)Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.voidcreateView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, Handler<AsyncResult<java.lang.Void>> resultHandler)Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.Future<java.lang.Void>createView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions)Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.voidcreateView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.Future<java.lang.Void>createView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline)Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.voidcreateView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, Handler<AsyncResult<java.lang.Void>> resultHandler)Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.Future<java.lang.Void>createView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions)Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.voidcreateView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.Future<java.lang.Void>drop()Drops this database.voiddrop(Handler<AsyncResult<java.lang.Void>> resultHandler)Drops this database.Future<java.lang.Void>drop(ClientSession clientSession)Drops this database.voiddrop(ClientSession clientSession, Handler<AsyncResult<java.lang.Void>> resultHandler)Drops this database.CodecRegistrygetCodecRegistry()Get the codec registry for the MongoDatabase.MongoCollection<JsonObject>getCollection(java.lang.String collectionName)Gets a collection.<TDocument>
MongoCollection<TDocument>getCollection(java.lang.String collectionName, java.lang.Class<TDocument> clazz)Gets a collection, with a specific default document class.java.lang.StringgetName()Gets the name of the database.ReadConcerngetReadConcern()Get the read concern for the MongoCollection.ReadPreferencegetReadPreference()Get the read preference for the MongoDatabase.WriteConcerngetWriteConcern()Get the write concern for the MongoDatabase.MongoResult<java.lang.String>listCollectionNames()Gets the names of all the collections in this database.MongoResult<java.lang.String>listCollectionNames(ClientSession clientSession)Gets the names of all the collections in this database.MongoResult<JsonObject>listCollections()Finds all the collections in this database.MongoResult<JsonObject>listCollections(ClientSession clientSession)Finds all the collections in this database.MongoResult<JsonObject>listCollections(ClientSession clientSession, ListCollectionsOptions options)Finds all the collections in this database.MongoResult<JsonObject>listCollections(ListCollectionsOptions options)Finds all the collections in this database.Future<JsonObject>runCommand(JsonObject command)Executes command in the context of the current database.Future<JsonObject>runCommand(JsonObject command, ReadPreference readPreference)Executes command in the context of the current database.voidrunCommand(JsonObject command, ReadPreference readPreference, Handler<AsyncResult<JsonObject>> resultHandler)Executes command in the context of the current database.voidrunCommand(JsonObject command, Handler<AsyncResult<JsonObject>> resultHandler)Executes command in the context of the current database.Future<JsonObject>runCommand(ClientSession clientSession, JsonObject command)Executes command in the context of the current database.Future<JsonObject>runCommand(ClientSession clientSession, JsonObject command, ReadPreference readPreference)Executes command in the context of the current database.voidrunCommand(ClientSession clientSession, JsonObject command, ReadPreference readPreference, Handler<AsyncResult<JsonObject>> resultHandler)Executes command in the context of the current database.voidrunCommand(ClientSession clientSession, JsonObject command, Handler<AsyncResult<JsonObject>> resultHandler)Executes command in the context of the current database.MongoResult<ChangeStreamDocument<JsonObject>>watch()Creates a change stream for this database.MongoResult<ChangeStreamDocument<JsonObject>>watch(JsonArray pipeline)Creates a change stream for this database.MongoResult<ChangeStreamDocument<JsonObject>>watch(JsonArray pipeline, ChangeStreamOptions options)Creates a change stream for this database.MongoResult<ChangeStreamDocument<JsonObject>>watch(ChangeStreamOptions options)Creates a change stream for this database.MongoResult<ChangeStreamDocument<JsonObject>>watch(ClientSession clientSession)Creates a change stream for this database.MongoResult<ChangeStreamDocument<JsonObject>>watch(ClientSession clientSession, JsonArray pipeline)Creates a change stream for this database.MongoResult<ChangeStreamDocument<JsonObject>>watch(ClientSession clientSession, JsonArray pipeline, ChangeStreamOptions options)Creates a change stream for this database.MongoResult<ChangeStreamDocument<JsonObject>>watch(ClientSession clientSession, ChangeStreamOptions options)Creates a change stream for this database.MongoDatabasewithCodecRegistry(CodecRegistry codecRegistry)Create a new MongoDatabase instance with a different codec registry.MongoDatabasewithReadConcern(ReadConcern readConcern)Create a new MongoDatabase instance with a different read concern.MongoDatabasewithReadPreference(ReadPreference readPreference)Create a new MongoDatabase instance with a different read preference.MongoDatabasewithWriteConcern(WriteConcern writeConcern)Create a new MongoDatabase instance with a different write concern.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the database.- Returns:
- the database name
-
getCodecRegistry
CodecRegistry getCodecRegistry()
Get the codec registry for the MongoDatabase.- Returns:
- the
CodecRegistry
-
getReadPreference
ReadPreference getReadPreference()
Get the read preference for the MongoDatabase.- Returns:
- the
ReadPreference
-
getWriteConcern
WriteConcern getWriteConcern()
Get the write concern for the MongoDatabase.- Returns:
- the
WriteConcern
-
getReadConcern
ReadConcern getReadConcern()
Get the read concern for the MongoCollection.- Returns:
- the
ReadConcern - Since:
- 1.2
- Since server release
- 3.2
-
withCodecRegistry
MongoDatabase withCodecRegistry(CodecRegistry codecRegistry)
Create a new MongoDatabase instance with a different codec registry.- Parameters:
codecRegistry- the newCodecRegistryfor the collection- Returns:
- a new MongoDatabase instance with the different codec registry
-
withReadPreference
MongoDatabase withReadPreference(ReadPreference readPreference)
Create a new MongoDatabase instance with a different read preference.- Parameters:
readPreference- the newReadPreferencefor the collection- Returns:
- a new MongoDatabase instance with the different readPreference
-
withWriteConcern
MongoDatabase withWriteConcern(WriteConcern writeConcern)
Create a new MongoDatabase instance with a different write concern.- Parameters:
writeConcern- the newWriteConcernfor the collection- Returns:
- a new MongoDatabase instance with the different writeConcern
-
withReadConcern
MongoDatabase withReadConcern(ReadConcern readConcern)
Create a new MongoDatabase instance with a different read concern.- Parameters:
readConcern- the newReadConcernfor the collection- Returns:
- a new MongoDatabase instance with the different ReadConcern
- Since:
- 1.2
- Since server release
- 3.2
-
getCollection
MongoCollection<JsonObject> getCollection(java.lang.String collectionName)
Gets a collection.- Parameters:
collectionName- the name of the collection to return- Returns:
- the collection
-
getCollection
<TDocument> MongoCollection<TDocument> getCollection(java.lang.String collectionName, java.lang.Class<TDocument> clazz)
Gets a collection, with a specific default document class.- Type Parameters:
TDocument- the type of the class to use instead ofDocument.- Parameters:
collectionName- the name of the collection to returnclazz- the default class to cast any documents returned from the database into.- Returns:
- the collection
-
runCommand
Future<JsonObject> runCommand(JsonObject command)
Executes command in the context of the current database.- Parameters:
command- the command to be run- Returns:
- a future containing the command result
-
runCommand
void runCommand(JsonObject command, Handler<AsyncResult<JsonObject>> resultHandler)
Executes command in the context of the current database.- Parameters:
command- the command to be runresultHandler- an async result containing the command result
-
runCommand
Future<JsonObject> runCommand(JsonObject command, ReadPreference readPreference)
Executes command in the context of the current database.- Parameters:
command- the command to be runreadPreference- theReadPreferenceto be used when executing the command- Returns:
- a future containing the command result
-
runCommand
void runCommand(JsonObject command, ReadPreference readPreference, Handler<AsyncResult<JsonObject>> resultHandler)
Executes command in the context of the current database.- Parameters:
command- the command to be runreadPreference- theReadPreferenceto be used when executing the commandresultHandler- an async result containing the command result
-
runCommand
Future<JsonObject> runCommand(ClientSession clientSession, JsonObject command)
Executes command in the context of the current database.- Parameters:
clientSession- the client session with which to associate this operationcommand- the command to be run- Returns:
- a future containing the command result
- Since:
- 1.7
- Since server release
- 3.6
-
runCommand
void runCommand(ClientSession clientSession, JsonObject command, Handler<AsyncResult<JsonObject>> resultHandler)
Executes command in the context of the current database.- Parameters:
clientSession- the client session with which to associate this operationcommand- the command to be runresultHandler- an async result containing the command result- Since:
- 1.7
- Since server release
- 3.6
-
runCommand
Future<JsonObject> runCommand(ClientSession clientSession, JsonObject command, ReadPreference readPreference)
Executes command in the context of the current database.- Parameters:
clientSession- the client session with which to associate this operationcommand- the command to be runreadPreference- theReadPreferenceto be used when executing the command- Returns:
- a future containing the command result
- Since:
- 1.7
- Since server release
- 3.6
-
runCommand
void runCommand(ClientSession clientSession, JsonObject command, ReadPreference readPreference, Handler<AsyncResult<JsonObject>> resultHandler)
Executes command in the context of the current database.- Parameters:
clientSession- the client session with which to associate this operationcommand- the command to be runreadPreference- theReadPreferenceto be used when executing the commandresultHandler- an async result containing the command result- Since:
- 1.7
- Since server release
- 3.6
-
drop
Future<java.lang.Void> drop()
Drops this database.- Returns:
- a future identifying when the database has been dropped
- MongoDB documentation
- Drop database
-
drop
void drop(Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops this database.- Parameters:
resultHandler- an async result identifying when the database has been dropped- MongoDB documentation
- Drop database
-
drop
Future<java.lang.Void> drop(ClientSession clientSession)
Drops this database.- Parameters:
clientSession- the client session with which to associate this operation- Returns:
- a future identifying when the database has been dropped
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop database
-
drop
void drop(ClientSession clientSession, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops this database.- Parameters:
clientSession- the client session with which to associate this operationresultHandler- an async result identifying when the database has been dropped- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop database
-
listCollectionNames
MongoResult<java.lang.String> listCollectionNames()
Gets the names of all the collections in this database.- Returns:
- a result with all the names of all the collections in this database
-
listCollectionNames
MongoResult<java.lang.String> listCollectionNames(ClientSession clientSession)
Gets the names of all the collections in this database.- Parameters:
clientSession- the client session with which to associate this operation- Returns:
- a result with all the names of all the collections in this database
- Since:
- 1.7
- Since server release
- 3.6
-
listCollections
MongoResult<JsonObject> listCollections()
Finds all the collections in this database.- Returns:
- the fluent list collections interface
- MongoDB documentation
- listCollections
-
listCollections
MongoResult<JsonObject> listCollections(ListCollectionsOptions options)
Finds all the collections in this database.- Parameters:
options- options- Returns:
- the fluent list collections interface
- MongoDB documentation
- listCollections
-
listCollections
MongoResult<JsonObject> listCollections(ClientSession clientSession)
Finds all the collections in this database.- Parameters:
clientSession- the client session with which to associate this operation- Returns:
- the fluent list collections interface
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- listCollections
-
listCollections
MongoResult<JsonObject> listCollections(ClientSession clientSession, ListCollectionsOptions options)
Finds all the collections in this database.- Parameters:
clientSession- the client session with which to associate this operationoptions- options- Returns:
- the fluent list collections interface
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- listCollections
-
createCollection
Future<java.lang.Void> createCollection(java.lang.String collectionName)
Create a new collection with the given name.- Parameters:
collectionName- the name for the new collection to create- Returns:
- a future identifying when the collection has been created
- MongoDB documentation
- Create Command
-
createCollection
void createCollection(java.lang.String collectionName, Handler<AsyncResult<java.lang.Void>> resultHandler)Create a new collection with the given name.- Parameters:
collectionName- the name for the new collection to createresultHandler- an async result identifying when the collection has been created- MongoDB documentation
- Create Command
-
createCollection
Future<java.lang.Void> createCollection(java.lang.String collectionName, CreateCollectionOptions options)
Create a new collection with the selected options- Parameters:
collectionName- the name for the new collection to createoptions- various options for creating the collection- Returns:
- a future identifying when the collection has been created
- MongoDB documentation
- Create Command
-
createCollection
void createCollection(java.lang.String collectionName, CreateCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)Create a new collection with the selected options- Parameters:
collectionName- the name for the new collection to createoptions- various options for creating the collectionresultHandler- an async result identifying when the collection has been created- MongoDB documentation
- Create Command
-
createCollection
Future<java.lang.Void> createCollection(ClientSession clientSession, java.lang.String collectionName)
Create a new collection with the given name.- Parameters:
clientSession- the client session with which to associate this operationcollectionName- the name for the new collection to create- Returns:
- a future identifying when the collection has been created
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
createCollection
void createCollection(ClientSession clientSession, java.lang.String collectionName, Handler<AsyncResult<java.lang.Void>> resultHandler)
Create a new collection with the given name.- Parameters:
clientSession- the client session with which to associate this operationcollectionName- the name for the new collection to createresultHandler- an async result identifying when the collection has been created- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
createCollection
Future<java.lang.Void> createCollection(ClientSession clientSession, java.lang.String collectionName, CreateCollectionOptions options)
Create a new collection with the selected options- Parameters:
clientSession- the client session with which to associate this operationcollectionName- the name for the new collection to createoptions- various options for creating the collection- Returns:
- a future identifying when the collection has been created
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
createCollection
void createCollection(ClientSession clientSession, java.lang.String collectionName, CreateCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)
Create a new collection with the selected options- Parameters:
clientSession- the client session with which to associate this operationcollectionName- the name for the new collection to createoptions- various options for creating the collectionresultHandler- an async result identifying when the collection has been created- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
createView
Future<java.lang.Void> createView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline)
Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.- Parameters:
viewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the view- Returns:
- an future identifying when the collection view has been created
- Since:
- 1.3
- Since server release
- 3.4
- MongoDB documentation
- Create Command
-
createView
void createView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, Handler<AsyncResult<java.lang.Void>> resultHandler)Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.- Parameters:
viewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the viewresultHandler- an async result identifying when the collection view has been created- Since:
- 1.3
- Since server release
- 3.4
- MongoDB documentation
- Create Command
-
createView
Future<java.lang.Void> createView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions)
Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.- Parameters:
viewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the viewcreateViewOptions- various options for creating the view- Returns:
- an future identifying when the collection view has been created
- Since:
- 1.3
- Since server release
- 3.4
- MongoDB documentation
- Create Command
-
createView
void createView(java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.- Parameters:
viewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the viewcreateViewOptions- various options for creating the viewresultHandler- an async result identifying when the collection view has been created- Since:
- 1.3
- Since server release
- 3.4
- MongoDB documentation
- Create Command
-
createView
Future<java.lang.Void> createView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline)
Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.- Parameters:
clientSession- the client session with which to associate this operationviewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the view- Returns:
- an future identifying when the collection view has been created
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
createView
void createView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, Handler<AsyncResult<java.lang.Void>> resultHandler)
Creates a view with the given name, backing collection/view name, and aggregation pipeline that defines the view.- Parameters:
clientSession- the client session with which to associate this operationviewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the viewresultHandler- an async result identifying when the collection view has been created- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
createView
Future<java.lang.Void> createView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions)
Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.- Parameters:
clientSession- the client session with which to associate this operationviewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the viewcreateViewOptions- various options for creating the view- Returns:
- an future identifying when the collection view has been created
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
createView
void createView(ClientSession clientSession, java.lang.String viewName, java.lang.String viewOn, JsonArray pipeline, CreateViewOptions createViewOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.- Parameters:
clientSession- the client session with which to associate this operationviewName- the name of the view to createviewOn- the backing collection/view for the viewpipeline- the pipeline that defines the viewcreateViewOptions- various options for creating the viewresultHandler- an async result identifying when the collection view has been created- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create Command
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch()
Creates a change stream for this database.- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ChangeStreamOptions options)
Creates a change stream for this database.- Parameters:
options- options- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(JsonArray pipeline)
Creates a change stream for this database.- Parameters:
pipeline- the aggregation pipeline to apply to the change stream.- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(JsonArray pipeline, ChangeStreamOptions options)
Creates a change stream for this database.- Parameters:
pipeline- the aggregation pipeline to apply to the change stream.options- options- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession)
Creates a change stream for this database.- Parameters:
clientSession- the client session with which to associate this operation- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession, ChangeStreamOptions options)
Creates a change stream for this database.- Parameters:
clientSession- the client session with which to associate this operationoptions- options- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession, JsonArray pipeline)
Creates a change stream for this database.- Parameters:
clientSession- the client session with which to associate this operationpipeline- the aggregation pipeline to apply to the change stream.- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession, JsonArray pipeline, ChangeStreamOptions options)
Creates a change stream for this database.- Parameters:
clientSession- the client session with which to associate this operationpipeline- the aggregation pipeline to apply to the change stream.options- options- Returns:
- the change stream read stream
- Since:
- 1.9
- Since server release
- 4.0
- MongoDB documentation
- Change Streams
-
aggregate
MongoCollectionResult<JsonObject> aggregate(JsonArray pipeline)
Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.- Parameters:
pipeline- the aggregation pipeline- Returns:
- an result containing the result of the aggregation operation
- Since:
- 1.11
- Since server release
- 3.6
- MongoDB documentation
- Aggregate Command
-
aggregate
MongoCollectionResult<JsonObject> aggregate(JsonArray pipeline, AggregateOptions options)
Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.- Parameters:
pipeline- the aggregation pipelineoptions- options- Returns:
- an result containing the result of the aggregation operation
- Since:
- 1.11
- Since server release
- 3.6
- MongoDB documentation
- Aggregate Command
-
aggregate
MongoCollectionResult<JsonObject> aggregate(ClientSession clientSession, JsonArray pipeline)
Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.- Parameters:
clientSession- the client session with which to associate this operationpipeline- the aggregation pipeline- Returns:
- an result containing the result of the aggregation operation
- Since:
- 1.11
- Since server release
- 3.6
- MongoDB documentation
- Aggregate Command
-
aggregate
MongoCollectionResult<JsonObject> aggregate(ClientSession clientSession, JsonArray pipeline, AggregateOptions options)
Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as$currentOpand$listLocalSessions.- Parameters:
clientSession- the client session with which to associate this operationpipeline- the aggregation pipelineoptions- options- Returns:
- an result containing the result of the aggregation operation
- Since:
- 1.11
- Since server release
- 3.6
- MongoDB documentation
- Aggregate Command
-
-