Skip to content
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

micronaut data mongo not updating/saving/listing nested collection #3276

Open
brucemelo opened this issue Dec 27, 2024 · 0 comments
Open

micronaut data mongo not updating/saving/listing nested collection #3276

brucemelo opened this issue Dec 27, 2024 · 0 comments

Comments

@brucemelo
Copy link

brucemelo commented Dec 27, 2024

Expected Behavior

micronaut data mongo should save/update/listing nested collection.collections

Actual Behaviour

I have a movie and nested movies, I want to update the nested and list all movies with nested, for example.

I've tried the same thing with spring data mongo and worked

mapping spring

@Document
public record Movie(
        @Id
        ObjectId id,
        String title,
        @DBRef
        Set<Movie> next
)  {
}

mapping micronaut

@Serdeable
@MappedEntity(value = "movies")
public record Movie(
        @Id
        @GeneratedValue
        ObjectId id,
        @Nullable
        String title,
        @Nullable
        @Relation(value = Relation.Kind.ONE_TO_MANY) //tried with mappedBy = "movies"
        Set<Movie> next
) {

}

Steps To Reproduce

repo https://github.com/brucemelo/micronaut-mongo-issue

Environment Information

macos
java 21

Example Application

https://github.com/brucemelo/micronaut-mongo-issue

Version

micronautVersion=4.7.3

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

No branches or pull requests

1 participant