Skip to content

Commit 5d89fe5

Browse files
committed
CSHARP-2619: Documentation for countDocuments MUST mention estimatedDocumentCount
1 parent f809794 commit 5d89fe5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/MongoDB.Driver.Core/Core/Operations/CountDocumentsOperation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace MongoDB.Driver.Core.Operations
2727
{
2828
/// <summary>
2929
/// Represents a count documents operation.
30+
/// For a fast estimate of the total documents in a collection see <see cref="CountOperation"/>.
3031
/// </summary>
3132
public class CountDocumentsOperation : IReadOperation<long>
3233
{

src/MongoDB.Driver/IMongoCollection.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public interface IMongoCollection<TDocument>
198198

199199
/// <summary>
200200
/// Counts the number of documents in the collection.
201+
/// For a fast estimate of the total documents in a collection see <see cref="EstimatedDocumentCount"/>.
201202
/// </summary>
202203
/// <remarks>
203204
/// Note: when migrating from Count to CountDocuments the following query operations must be replaced:
@@ -224,6 +225,7 @@ public interface IMongoCollection<TDocument>
224225

225226
/// <summary>
226227
/// Counts the number of documents in the collection.
228+
/// For a fast estimate of the total documents in a collection see <see cref="EstimatedDocumentCount"/>.
227229
/// </summary>
228230
/// <remarks>
229231
/// Note: when migrating from Count to CountDocuments the following query operations must be replaced:
@@ -251,6 +253,7 @@ public interface IMongoCollection<TDocument>
251253

252254
/// <summary>
253255
/// Counts the number of documents in the collection.
256+
/// For a fast estimate of the total documents in a collection see <seea cref="EstimatedDocumentCountAsync"/>.
254257
/// </summary>
255258
/// <remarks>
256259
/// Note: when migrating from CountAsync to CountDocumentsAsync the following query operations must be replaced:
@@ -277,6 +280,7 @@ public interface IMongoCollection<TDocument>
277280

278281
/// <summary>
279282
/// Counts the number of documents in the collection.
283+
/// For a fast estimate of the total documents in a collection see <see cref="EstimatedDocumentCountAsync"/>.
280284
/// </summary>
281285
/// <remarks>
282286
/// Note: when migrating from CountAsync to CountDocumentsAsync the following query operations must be replaced:

src/MongoDB.Driver/IMongoCollectionExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ public static IMongoQueryable<TDocument> AsQueryable<TDocument>(this IMongoColle
163163

164164
/// <summary>
165165
/// Counts the number of documents in the collection.
166+
/// For a fast estimate of the total documents in a collection see <see cref="IMongoCollection{TDocument}.EstimatedDocumentCount"/>.
166167
/// </summary>
167168
/// <typeparam name="TDocument">The type of the document.</typeparam>
168169
/// <param name="collection">The collection.</param>
@@ -182,6 +183,7 @@ public static IMongoQueryable<TDocument> AsQueryable<TDocument>(this IMongoColle
182183

183184
/// <summary>
184185
/// Counts the number of documents in the collection.
186+
/// For a fast estimate of the total documents in a collection see <see cref="IMongoCollection{TDocument}.EstimatedDocumentCount"/>.
185187
/// </summary>
186188
/// <typeparam name="TDocument">The type of the document.</typeparam>
187189
/// <param name="session">The session.</param>
@@ -203,6 +205,7 @@ public static IMongoQueryable<TDocument> AsQueryable<TDocument>(this IMongoColle
203205

204206
/// <summary>
205207
/// Counts the number of documents in the collection.
208+
/// For a fast estimate of the total documents in a collection see <see cref="IMongoCollection{TDocument}.EstimatedDocumentCountAsync"/>.
206209
/// </summary>
207210
/// <typeparam name="TDocument">The type of the document.</typeparam>
208211
/// <param name="collection">The collection.</param>
@@ -222,6 +225,7 @@ public static IMongoQueryable<TDocument> AsQueryable<TDocument>(this IMongoColle
222225

223226
/// <summary>
224227
/// Counts the number of documents in the collection.
228+
/// For a fast estimate of the total documents in a collection see <see cref="IMongoCollection{TDocument}.EstimatedDocumentCountAsync"/>.
225229
/// </summary>
226230
/// <typeparam name="TDocument">The type of the document.</typeparam>
227231
/// <param name="collection">The collection.</param>

0 commit comments

Comments
 (0)