Skip to content

Conversation

DarshanaVenkatesh
Copy link
Collaborator

@DarshanaVenkatesh DarshanaVenkatesh commented Aug 20, 2025

Description

  • If <8.1 for compass and <8.0 in de, disable search stages for views with added text 'Requires MongoDB 8.1/8.0+ to run on a view.' in description.
  • If not search queryable, disable search stage for views with added text 'Only views containing $addFields, $set or $match stages with the $expr operator are compatible with search indexes.'
aggregation_selector.mov

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the feat label Aug 20, 2025
@DarshanaVenkatesh DarshanaVenkatesh added the no release notes Fix or feature not for release notes label Aug 21, 2025
(!pipelineIsSearchQueryable ||
versionIncompatibleCompass ||
versionIncompatibleDE);

return (
<Combobox
value={selectedStage}
Copy link
Collaborator Author

@DarshanaVenkatesh DarshanaVenkatesh Aug 25, 2025

Choose a reason for hiding this comment

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

One problem I'm having is that the text cuts off in 0:38 of the video.

It should say 'Atlas only. Only views containing $addFields, $set or $match stages with the $expr operator are compatible with search indexes. Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.' but it cuts off at 'gets back'.

I've tried using chipCharacterLimit and chipTruncationLocation as specified : https://www.mongodb.design/component/combobox/code-docs but this doesn't seem to change anything?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to be an option related to multi select combobox, not to the descriptions

@DarshanaVenkatesh DarshanaVenkatesh marked this pull request as ready for review August 25, 2025 07:42
@Copilot Copilot AI review requested due to automatic review settings August 25, 2025 07:42
@DarshanaVenkatesh DarshanaVenkatesh requested a review from a team as a code owner August 25, 2025 07:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for search stages in aggregation views with version and compatibility checks. The changes implement conditional disabling of search stages based on MongoDB version compatibility and view pipeline queryability requirements.

  • Adds version compatibility checks for search stages on views (MongoDB 8.0+/8.1+ requirement)
  • Implements pipeline queryability validation for search index compatibility
  • Updates collection stats to include pipeline information for view compatibility checks

Reviewed Changes

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

File Description
packages/compass-aggregations/src/modules/collection-stats.ts Adds pipeline field to collection stats to support view compatibility checks
packages/compass-aggregations/src/components/stage-toolbar/stage-operator-select.tsx Implements search stage validation logic with version checks and dynamic descriptions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lerouxb
Copy link
Contributor

lerouxb commented Aug 25, 2025

Can you explain somewhere why DE and Compass have different minimum server versions?

@DarshanaVenkatesh
Copy link
Collaborator Author

DarshanaVenkatesh commented Aug 26, 2025

Can you explain somewhere why DE and Compass have different minimum server versions?

Sorry I misunderstood something but yes you're right DE itself isn't related to server version 8.1+. ̶W̶e̶ ̶a̶r̶e̶ ̶n̶o̶t̶ ̶d̶i̶s̶p̶l̶a̶y̶i̶n̶g̶ ̶t̶h̶e̶ ̶s̶e̶a̶r̶c̶h̶ ̶s̶t̶a̶g̶e̶s̶ ̶i̶n̶ ̶D̶a̶t̶a̶ ̶E̶x̶p̶l̶o̶r̶e̶r̶,̶ ̶o̶n̶l̶y̶ ̶C̶o̶m̶p̶a̶s̶s̶. I removed the extra check and made it only check Compass version for compatibility.

@gribnoysup
Copy link
Collaborator

Hey @DarshanaVenkatesh, can you clarify, if we don't need to differenciate by version here, does it also mean we didn't need to do it in this PR? Because Le Roux is basically asking the same thing I asked you before, so just want to make sure we're not introducing unexpected differences in behavior for desktop and web that otherwise in most cases always behave the same

@DarshanaVenkatesh
Copy link
Collaborator Author

Hey @DarshanaVenkatesh, can you clarify, if we don't need to differenciate by version here, does it also mean we didn't need to do it in this PR? Because Le Roux is basically asking the same thing I asked you before, so just want to make sure we're not introducing unexpected differences in behavior for desktop and web that otherwise in most cases always behave the same

That pr should differentiate in the banners because we want to direct users to the atlas search indexes page for data explorer. So yes, we want banners with the server version difference because that's mentioning the server version in Atlas vs Compass (not necessarily data explorer).

@DarshanaVenkatesh DarshanaVenkatesh changed the title feat(compass-aggregations): add search stages for views COMPASS-9693 feat(compass-aggregations): disable search stages for incompatible views COMPASS-9693 Aug 26, 2025
Comment on lines +100 to +104
// filter out search stages for data explorer
const filteredStages =
isReadonlyView && !enableAtlasSearchIndexes
? stages.filter((stage) => !isSearchStage(stage.name))
: stages;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is this requirement coming from? This is a weird change in compass behavior only for data explorer. Why are you not allowed to see actually working stages in aggregation builder based on a completely different feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat no release notes Fix or feature not for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants