0

I have below Pojo class for the mongo entity

public class Product {
    @BsonProperty("_id")
    @BsonId
    private ObjectId id;
    private String name;
    private float price;
    private String description;
}

when I fetch the mongo result as per the below code

var item = Flowable.fromPublisher(this.repository.getCollection("product", Product.class).find()).blockingIterable();

The id id mapped something like this

enter image description here

However, in the database the id is something like this

enter image description here

How do I map this id in the correct way, I am using Micronaut framework with java 15

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.