MongoCollection Class |
Namespace: MongoDB.Driver
The MongoCollection type exposes the following members.
Name | Description | |
---|---|---|
MongoCollection |
Protected constructor for abstract base class.
|
Name | Description | |
---|---|---|
Aggregate |
Represents an aggregate framework query. The command is not sent to the server until the result is enumerated.
| |
AggregateExplain |
Runs an aggregate command with explain set and returns the explain result.
| |
Count() |
Counts the number of documents in this collection.
| |
Count(CountArgs) |
Counts the number of documents in this collection that match a query.
| |
Count(IMongoQuery) |
Counts the number of documents in this collection that match a query.
| |
CreateIndex(String[]) |
Creates an index for this collection.
| |
CreateIndex(IMongoIndexKeys) |
Creates an index for this collection.
| |
CreateIndex(IMongoIndexKeys, IMongoIndexOptions) |
Creates an index for this collection.
| |
Distinct(String) |
Returns the distinct values for a given field.
| |
Distinct(String, IMongoQuery) |
Returns the distinct values for a given field for documents that match a query.
| |
Distinct<TValue>(String) |
Returns the distinct values for a given field.
| |
Distinct<TValue>(DistinctArgs) |
Returns the distinct values for a given field.
| |
Distinct<TValue>(String, IMongoQuery) |
Returns the distinct values for a given field for documents that match a query.
| |
Drop |
Drops this collection.
| |
DropAllIndexes |
Drops all indexes on this collection.
| |
DropIndex(String[]) |
Drops an index on this collection.
| |
DropIndex(IMongoIndexKeys) |
Drops an index on this collection.
| |
DropIndexByName |
Drops an index on this collection.
| |
EnsureIndex(String[]) | Obsolete.
Ensures that the desired index exists and creates it if it does not.
| |
EnsureIndex(IMongoIndexKeys) | Obsolete.
Ensures that the desired index exists and creates it if it does not.
| |
EnsureIndex(IMongoIndexKeys, IMongoIndexOptions) | Obsolete.
Ensures that the desired index exists and creates it if it does not.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Exists |
Tests whether this collection exists.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FindAllAs(Type) |
Returns a cursor that can be used to find all documents in this collection as TDocuments.
| |
FindAllAs<TDocument>() |
Returns a cursor that can be used to find all documents in this collection as TDocuments.
| |
FindAndModify(FindAndModifyArgs) |
Finds one matching document using the supplied arguments and applies the specified update to it.
| |
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate) | Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
| |
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, Boolean) | Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
| |
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, Boolean, Boolean) | Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
| |
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, IMongoFields, Boolean, Boolean) | Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
| |
FindAndRemove(FindAndRemoveArgs) |
Finds one matching document using the supplied args and removes it from this collection.
| |
FindAndRemove(IMongoQuery, IMongoSortBy) | Obsolete.
Finds one matching document using the query and sortBy parameters and removes it from this collection.
| |
FindAs(Type, IMongoQuery) |
Returns a cursor that can be used to find all documents in this collection that match the query as TDocuments.
| |
FindAs<TDocument>(IMongoQuery) |
Returns a cursor that can be used to find all documents in this collection that match the query as TDocuments.
| |
FindOneAs(Type) |
Returns one document in this collection as a TDocument.
| |
FindOneAs(Type, FindOneArgs) |
Returns one document in this collection as a TDocument.
| |
FindOneAs(Type, IMongoQuery) |
Returns one document in this collection that matches a query as a TDocument.
| |
FindOneAs<TDocument>() |
Returns one document in this collection as a TDocument.
| |
FindOneAs<TDocument>(FindOneArgs) |
Returns one document in this collection as a TDocument.
| |
FindOneAs<TDocument>(IMongoQuery) |
Returns one document in this collection that matches a query as a TDocument.
| |
FindOneByIdAs(Type, BsonValue) |
Returns a cursor that can be used to find one document in this collection by its _id value as a TDocument.
| |
FindOneByIdAs<TDocument>(BsonValue) |
Returns a cursor that can be used to find one document in this collection by its _id value as a TDocument.
| |
GeoHaystackSearchAs(Type, GeoHaystackSearchArgs) |
Runs a geoHaystack search command on this collection.
| |
GeoHaystackSearchAs(Type, Double, Double, IMongoGeoHaystackSearchOptions) | Obsolete.
Runs a geoHaystack search command on this collection.
| |
GeoHaystackSearchAs<TDocument>(GeoHaystackSearchArgs) |
Runs a geoHaystack search command on this collection.
| |
GeoHaystackSearchAs<TDocument>(Double, Double, IMongoGeoHaystackSearchOptions) | Obsolete.
Runs a geoHaystack search command on this collection.
| |
GeoNearAs(Type, GeoNearArgs) |
Runs a GeoNear command on this collection.
| |
GeoNearAs(Type, IMongoQuery, Double, Double, Int32) | Obsolete.
Runs a GeoNear command on this collection.
| |
GeoNearAs(Type, IMongoQuery, Double, Double, Int32, IMongoGeoNearOptions) | Obsolete.
Runs a GeoNear command on this collection.
| |
GeoNearAs<TDocument>(GeoNearArgs) |
Runs a GeoNear command on this collection.
| |
GeoNearAs<TDocument>(IMongoQuery, Double, Double, Int32) | Obsolete.
Runs a GeoNear command on this collection.
| |
GeoNearAs<TDocument>(IMongoQuery, Double, Double, Int32, IMongoGeoNearOptions) | Obsolete.
Runs a GeoNear command on this collection.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetIndexes |
Gets the indexes for this collection.
| |
GetStats() |
Gets the stats for this collection.
| |
GetStats(GetStatsArgs) |
Gets the stats for this collection.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Group(GroupArgs) |
Runs the group command on this collection.
| |
Group(IMongoQuery, BsonJavaScript, BsonDocument, BsonJavaScript, BsonJavaScript) |
Runs the group command on this collection.
| |
Group(IMongoQuery, IMongoGroupBy, BsonDocument, BsonJavaScript, BsonJavaScript) |
Runs the group command on this collection.
| |
Group(IMongoQuery, String, BsonDocument, BsonJavaScript, BsonJavaScript) |
Runs the group command on this collection.
| |
IndexExists(String[]) |
Tests whether an index exists.
| |
IndexExists(IMongoIndexKeys) |
Tests whether an index exists.
| |
IndexExistsByName |
Tests whether an index exists.
| |
InitializeOrderedBulkOperationAs<TDocument> |
Creates a fluent builder for an ordered bulk operation.
| |
InitializeUnorderedBulkOperationAs<TDocument> |
Creates a fluent builder for an unordered bulk operation.
| |
Insert(Type, Object) |
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
| |
Insert(Type, Object, MongoInsertOptions) |
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
| |
Insert(Type, Object, WriteConcern) |
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
| |
Insert<TNominalType>(TNominalType) |
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
| |
Insert<TNominalType>(TNominalType, MongoInsertOptions) |
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
| |
Insert<TNominalType>(TNominalType, WriteConcern) |
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
| |
InsertBatch(Type, IEnumerable) |
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
| |
InsertBatch(Type, IEnumerable, MongoInsertOptions) |
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
| |
InsertBatch(Type, IEnumerable, WriteConcern) |
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
| |
InsertBatch<TNominalType>(IEnumerable<TNominalType>) |
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
| |
InsertBatch<TNominalType>(IEnumerable<TNominalType>, MongoInsertOptions) |
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
| |
InsertBatch<TNominalType>(IEnumerable<TNominalType>, WriteConcern) |
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
| |
IsCapped |
Tests whether this collection is capped.
| |
MapReduce |
Runs a map-reduce command on this collection.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ParallelScanAs(Type, ParallelScanArgs) |
Scans an entire collection in parallel using multiple cursors.
| |
ParallelScanAs<TDocument>(ParallelScanArgs<TDocument>) |
Scans an entire collection in parallel using multiple cursors.
| |
ReIndex |
Runs the ReIndex command on this collection.
| |
Remove(IMongoQuery) |
Removes documents from this collection that match a query.
| |
Remove(RemoveArgs) |
Removes documents from this collection that match a query.
| |
Remove(IMongoQuery, RemoveFlags) |
Removes documents from this collection that match a query.
| |
Remove(IMongoQuery, WriteConcern) |
Removes documents from this collection that match a query.
| |
Remove(IMongoQuery, RemoveFlags, WriteConcern) |
Removes documents from this collection that match a query.
| |
RemoveAll() |
Removes all documents from this collection (see also Drop()).
| |
RemoveAll(WriteConcern) |
Removes all documents from this collection (see also Drop()).
| |
Save(Type, Object) |
Saves a document to this collection. The document must have an identifiable Id field. Based on the value
of the Id field Save will perform either an Insert or an Update.
| |
Save(Type, Object, MongoInsertOptions) |
Saves a document to this collection. The document must have an identifiable Id field. Based on the value
of the Id field Save will perform either an Insert or an Update.
| |
Save(Type, Object, WriteConcern) |
Saves a document to this collection. The document must have an identifiable Id field. Based on the value
of the Id field Save will perform either an Insert or an Update.
| |
Save<TNominalType>(TNominalType) |
Saves a document to this collection. The document must have an identifiable Id field. Based on the value
of the Id field Save will perform either an Insert or an Update.
| |
Save<TNominalType>(TNominalType, MongoInsertOptions) |
Saves a document to this collection. The document must have an identifiable Id field. Based on the value
of the Id field Save will perform either an Insert or an Update.
| |
Save<TNominalType>(TNominalType, WriteConcern) |
Saves a document to this collection. The document must have an identifiable Id field. Based on the value
of the Id field Save will perform either an Insert or an Update.
| |
ToString |
Gets a canonical string representation for this database.
(Overrides Object.ToString().) | |
Update(IMongoQuery, IMongoUpdate) |
Updates one matching document in this collection.
| |
Update(IMongoQuery, IMongoUpdate, MongoUpdateOptions) |
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
| |
Update(IMongoQuery, IMongoUpdate, UpdateFlags) |
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
| |
Update(IMongoQuery, IMongoUpdate, WriteConcern) |
Updates one matching document in this collection.
| |
Update(IMongoQuery, IMongoUpdate, UpdateFlags, WriteConcern) |
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
| |
Validate() |
Validates the integrity of this collection.
| |
Validate(ValidateCollectionArgs) |
Validates the integrity of this collection.
|
Name | Description | |
---|---|---|
AsQueryable<T> |
Returns an instance of IQueryable{{T}} for a MongoCollection.
(Defined by LinqExtensionMethods.) | |
ToBson |
Serializes an object to a BSON byte array.
(Defined by BsonExtensionMethods.) | |
ToBsonDocument |
Serializes an object to a BsonDocument.
(Defined by BsonExtensionMethods.) | |
ToJson |
Serializes an object to a JSON string.
(Defined by BsonExtensionMethods.) |
Name | Description | |
---|---|---|
Database |
Gets the database that contains this collection.
| |
FullName |
Gets the fully qualified name of this collection.
| |
Name |
Gets the name of this collection.
| |
Settings |
Gets the settings being used to access this collection.
|