I am trying to store _id
as a String in Mongo, but for some reason, mongo is still overriding and storing it as an ObjectId.
Below is my Java class
public class Subscription {
@JsonProperty("subscriptionId")
private String _id;
private List<FilterAttribute> filterAttributes;
}
Here is my code that saves the object.
private final MongoCollection<Subscription> mongoCollection;
mongoCollection.insertOne(subscription);
I tried a few methods but had no luck