title: Change MongoDb ObjectId _id to string in Micronaut using java
body: <p>I have below Pojo class for the mongo entity</p>
  <pre><code>public class Product {
      @BsonProperty(&quot;_id&quot;)
      @BsonId
      private ObjectId id;
      private String name;
      private float price;
      private String description;
  }
  </code></pre>
  <p>when I fetch the mongo result as per the below code</p>
  <pre><code>var item = Flowable.fromPublisher(this.repository.getCollection(&quot;product&quot;, Product.class).find()).blockingIterable();
  </code></pre>
  <p>The id id mapped something like this</p>
  <p><a href="https://i.stack.imgur.com/f85OT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f85OT.png" alt="enter image description here" /></a></p>
  <p>However, in the database the id is something like this</p>
  <p><a href="https://i.stack.imgur.com/Tvpyp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tvpyp.png" alt="enter image description here" /></a></p>
  <p>How do I map this id in the correct way, I am using Micronaut framework with java 15</p>