Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8723265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:35:25+00:00 2026-06-13T07:35:25+00:00

From MongoDb documentation: On a query using skip() and limit(), count ignores these parameters

  • 0

From MongoDb documentation: “On a query using skip() and limit(), count ignores these parameters by default. Use count(true) to have it consider the skip and limit values in the calculation.” That’s exactly what I need to count resulted elements for the specific query until it’s over defined limit like 1000, but I do not see any way to do it in c# driver. Count of IMongoCollection and SetCount of IMongoCursor are both parameter-less. Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:35:26+00:00Added an answer on June 13, 2026 at 7:35 am

    Use the Size method instead of Count, as that honors Skip and Limit.

    Console.WriteLine(collection.Find(query).SetSkip(0).SetLimit(1).Size());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the JavaScript mongodb driver from nodejs. I want to do this query
I have a simple script to get an export from MongoDB: #!/bin/sh -x QUERY='{
From MongoDB Documentation If you have a compound index on multiple fields, you can
I have a web page where users can see data from MongoDB on a
I am using mongoose/nodejs to get data as json from mongodb. For using mongoose
From the MongoDB manual: By default, all database strings are UTF8. To save images,
I have an applicaton written in PHP that retrieves files from mongoDB Grid collection,
Recently, I have updated from MongoDB 1.6 to MongoDB 2.0. I have populated several
I'm trying to retrieve only a subset of fields from mongodb using Java driver.
Is there any difference between using the field ID or _ID from a MongoDB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.