Class IMongoDatabaseExtensions
Extension methods on IMongoDatabase.
public static class IMongoDatabaseExtensions
- Inheritance
-
IMongoDatabaseExtensions
- Inherited Members
Methods
Aggregate(IMongoDatabase, AggregateOptions)
Begins a fluent aggregation interface.
public static IAggregateFluent<NoPipelineInput> Aggregate(this IMongoDatabase database, AggregateOptions options = null)
Parameters
database
IMongoDatabaseThe database.
options
AggregateOptionsThe options.
Returns
- IAggregateFluent<NoPipelineInput>
A fluent aggregate interface.
Aggregate(IMongoDatabase, IClientSessionHandle, AggregateOptions)
Begins a fluent aggregation interface.
public static IAggregateFluent<NoPipelineInput> Aggregate(this IMongoDatabase database, IClientSessionHandle session, AggregateOptions options = null)
Parameters
database
IMongoDatabaseThe database.
session
IClientSessionHandleThe session.
options
AggregateOptionsThe options.
Returns
- IAggregateFluent<NoPipelineInput>
A fluent aggregate interface.
AsQueryable(IMongoDatabase, AggregateOptions)
Creates a queryable source of documents.
public static IMongoQueryable<NoPipelineInput> AsQueryable(this IMongoDatabase database, AggregateOptions aggregateOptions = null)
Parameters
database
IMongoDatabaseThe database.
aggregateOptions
AggregateOptionsThe aggregate options
Returns
- IMongoQueryable<NoPipelineInput>
A queryable source of documents.
AsQueryable(IMongoDatabase, IClientSessionHandle, AggregateOptions)
Creates a queryable source of documents.
public static IMongoQueryable<NoPipelineInput> AsQueryable(this IMongoDatabase database, IClientSessionHandle session, AggregateOptions aggregateOptions = null)
Parameters
database
IMongoDatabaseThe collection.
session
IClientSessionHandleThe session.
aggregateOptions
AggregateOptionsThe aggregate options
Returns
- IMongoQueryable<NoPipelineInput>
A queryable source of documents.
Watch(IMongoDatabase, ChangeStreamOptions, CancellationToken)
Watches changes on all collection in a database.
public static IChangeStreamCursor<ChangeStreamDocument<BsonDocument>> Watch(this IMongoDatabase database, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
database
IMongoDatabaseThe database.
options
ChangeStreamOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- IChangeStreamCursor<ChangeStreamDocument<BsonDocument>>
A change stream.
Watch(IMongoDatabase, IClientSessionHandle, ChangeStreamOptions, CancellationToken)
Watches changes on all collection in a database.
public static IChangeStreamCursor<ChangeStreamDocument<BsonDocument>> Watch(this IMongoDatabase database, IClientSessionHandle session, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
database
IMongoDatabaseThe database.
session
IClientSessionHandleThe session.
options
ChangeStreamOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- IChangeStreamCursor<ChangeStreamDocument<BsonDocument>>
A change stream.
WatchAsync(IMongoDatabase, ChangeStreamOptions, CancellationToken)
Watches changes on all collection in a database.
public static Task<IChangeStreamCursor<ChangeStreamDocument<BsonDocument>>> WatchAsync(this IMongoDatabase database, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
database
IMongoDatabaseThe database.
options
ChangeStreamOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<IChangeStreamCursor<ChangeStreamDocument<BsonDocument>>>
A change stream.
WatchAsync(IMongoDatabase, IClientSessionHandle, ChangeStreamOptions, CancellationToken)
Watches changes on all collection in a database.
public static Task<IChangeStreamCursor<ChangeStreamDocument<BsonDocument>>> WatchAsync(this IMongoDatabase database, IClientSessionHandle session, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
database
IMongoDatabaseThe database.
session
IClientSessionHandleThe session.
options
ChangeStreamOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<IChangeStreamCursor<ChangeStreamDocument<BsonDocument>>>
A change stream.