Skip to content

Support flattening embedded/nested objects [DATAMONGO-1902] #2803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Mar 14, 2018 · 0 comments
Closed
Assignees
Labels
in: mapping Mapping and conversion infrastructure type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Tomasz Nurkiewicz opened DATAMONGO-1902 and commented

Having the following classes:

@Document
class Parent {
  int id;
  Child child;
}

class Child {
  String name;
}

Spring Data always produces the following document:

{
  "id": 1,
  "child": {
    "name": "Foo"
  }
}

It would be nice to have an annotation like @Embeddable so that the document looks like this:

{
  "id": 1,
  "name": "Foo"
}

NB: what about naming conflicts if both Parent and Child contain the same field


Issue Links:

Referenced from: pull request #896

1 votes, 2 watchers

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: mapping Mapping and conversion infrastructure labels Dec 30, 2020
@christophstrobl christophstrobl linked a pull request Feb 4, 2021 that will close this issue
@mp911de mp911de assigned christophstrobl and unassigned schauder Feb 16, 2021
@mp911de mp911de added this to the 3.2 M3 (2021.0.0) milestone Feb 16, 2021
mp911de added a commit that referenced this issue Feb 16, 2021
Reorder API methods, remove unused MongoPersistentProperty.isNullable method, reduce visibility where possible. Add Javadoc and tweak documentation wording.

Introduce DotPath utility to abstract dot path concatenation.

See #2803.
Original pull request: #896.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: mapping Mapping and conversion infrastructure type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants