Skip to content

Add test case for aggregation $count stage - #93

Merged
noisersup merged 1 commit into
OpenDocDB:mainfrom
noisersup:test-aggregation-stage-count
Jun 5, 2025
Merged

noisersup merged 1 commit into
OpenDocDB:mainfrom
noisersup:test-aggregation-stage-count

Conversation

@noisersup

@noisersup noisersup commented Jun 4, 2025 •

Copy link
Copy Markdown
Collaborator

No description provided.

@noisersup noisersup self-assigned this Jun 4, 2025
@noisersup
noisersup marked this pull request as ready for review June 4, 2025 15:23
Copilot AI review requested due to automatic review settings June 4, 2025 15:23
@noisersup
noisersup requested a review from AlekSi as a code owner June 4, 2025 15:23
@noisersup
noisersup enabled auto-merge (squash) June 4, 2025 15:24
@noisersup
noisersup requested a review from chilagrow June 4, 2025 15:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new test case for the aggregation $count stage to validate that running a simple count on a collection returns the correct total.

  • Introduces count.json in the CTS suite defining a request and expected response for counting documents.
  • Adds corresponding simple.request.js and simple.response.js in the mongosh test suite.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cts/aggregation/stages/count.json Defines a new CTS JSON test for a basic $count.
cts-mongosh/aggregation/stages/count/simple.request.js Adds the mongosh command invocation for the count.
cts-mongosh/aggregation/stages/count/simple.response.js Specifies the expected mongosh response object.
Comments suppressed due to low confidence (1)

cts/aggregation/stages/count.json:32

  • Consider adding a second test case for an empty collection to verify that $count returns an empty result when there are no documents.
}

Comment thread cts-mongosh/aggregation/stages/count/simple.request.js
Comment thread cts-mongosh/aggregation/stages/count/simple.request.js
@noisersup
noisersup merged commit f5b2979 into OpenDocDB:main Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants