Skip to content

Conversation

@paula-stacho
Copy link
Collaborator

Description

This is enabling selection of fields that are nested under an array or a mixed type

Screenshot 2025-08-04 at 11 55 41

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)

Copilot AI review requested due to automatic review settings August 4, 2025 09:58
@paula-stacho paula-stacho requested a review from a team as a code owner August 4, 2025 09:58
@github-actions github-actions bot added the fix label Aug 4, 2025
Copy link
Contributor

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 extracting fields from nested array and mixed type schemas in the data modeling store. The change enables selection of fields that are nested under items (array schemas) and anyOf (mixed type schemas).

  • Extends the extractFields function to handle anyOf and items schema properties
  • Recursively processes array items and union type schemas to discover nested fields
  • Adds comprehensive test coverage for the new functionality

Reviewed Changes

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

File Description
packages/compass-data-modeling/src/store/diagram.ts Adds recursive field extraction for anyOf and items schema properties
packages/compass-data-modeling/src/store/diagram.spec.ts Adds test cases covering flat, nested, array, and mixed type schema field extraction

@paula-stacho paula-stacho added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Aug 4, 2025
Comment on lines +369 to +374
items: {
bsonType: 'object',
properties: {
prop3A: { bsonType: 'string' },
},
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to add a case where items is an array? Seems possible based on the implementation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True, let me add it!

@paula-stacho paula-stacho merged commit 22cd678 into main Aug 5, 2025
59 checks passed
@paula-stacho paula-stacho deleted the COMPASS-9649 branch August 5, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature flagged PRs labeled with this label will not be included in the release notes of the next release fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants