Skip to content

Support nested level projections through interface-based projection [DATAMONGO-1989] #2860

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 May 28, 2018 · 2 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Dennis Nijssen opened DATAMONGO-1989 and commented

It would be great to support nested level projections through interfaces. Given a closed projection with a nested class, we would be able to support nested fields.

The document / collection class:

@Document
public class Person {

    private String firstName;
    private String lastName;
    private Address address;

    static class Address {

        private String zipCode, city;

        // getters and setters
    }

    // getters and setters
}

The closed projection interface:

public interface PersonSummary {

    String getFirstName();

    AddressSummary getAddress();

    interface AddressSummary {

        String getCity();
    }
}

Actual "fields" outcome right now:

fields: Document`firstName=1, address=1`

Expected "fields" outcome:

fields: Document`firstName=1, address.city=1`

 


Reference URL: https://stackoverflow.com/questions/50487231/spring-data-mongodb-interface-based-projection-recursively

1 votes, 2 watchers

@mp911de
Copy link
Member

mp911de commented Nov 24, 2021

@christophstrobl christophstrobl linked a pull request Dec 14, 2021 that will close this issue
@christophstrobl christophstrobl added this to the 3.4 M1 (2021.2.0) milestone Dec 14, 2021
@christophstrobl
Copy link
Member

christophstrobl commented Dec 14, 2021

resolved via #3894

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants