Source/Providers/NFX.MongoDB/Connector/Collection.cs
/// <summary>
/// Performs server-side count over cursor
/// </summary>
/// <param name="query">Optional. A query that selects which documents to count in a collection</param>
/// <param name="limit">Optional. The maximum number of matching documents to return</param>
/// <param name="skip">Optional. The number of matching documents to skip before returning results</param>
/// <param name="hint">Optional. The index to use. Specify either the index name as a string or the index specification document.</param>
/// <returns>Count </returns>
Performs server-side count over cursor
Performs server - side count over cursor
public long Count(Query query = null, int limit = -1, int skip = -1, object hint = null)
        { 
          EnsureObjectNotDisposed();
          if (hint!=null && (!(hint is string)) && (!(hint is BSONDocument)))
            throw new MongoDBConnectorException(StringConsts.ARGUMENT_ERROR+"Collection.Count(hint must be string | BSONDocument)");
          var connection = Server.AcquireConnection();
          try
          {
            var reqId = Database.NextRequestID;
            return connection.Count(reqId, this, query, limit, skip, hint);
          }
          finally
          {
            connection.Release();
          }
        }
public long Count ( Query query = null , int limit = - 1 , int skip = - 1 , object hint = null ) { EnsureObjectNotDisposed ( ) ; if ( hint != null && ( ! ( hint is string ) ) && ( ! ( hint is BSONDocument ) ) ) throw new MongoDBConnectorException ( StringConsts . ARGUMENT_ERROR + " " ) ; var connection = Server . AcquireConnection ( ) ; try { var reqId = Database . NextRequestID ; return connection . Count ( reqId , this , query , limit , skip , hint ) ; } finally { connection . Release ( ) ; } }
Performs server-side count over cursor
Performs server - side count over cursor
// See http://docs.mongodb.org/v3.0/reference/command/count/
None
query
Query
Optional. A query that selects which documents to count in a collection
Optional . A query that selects which documents to count in a collection
limit
int
Optional. The maximum number of matching documents to return
Optional . The maximum number of matching documents to return
skip
int
Optional. The number of matching documents to skip before returning results
Optional . The number of matching documents to skip before returning results
hint
object
Optional. The index to use. Specify either the index name as a string or the index specification document.
Optional . The index to use . Specify either the index name as a string or the index specification document .