how to disambiguate using @DocumentField in spring data mongoDB -
While using the Spring-Data Mongo DB, while trying to save the object in the DOB, I get this exception.
Suspicious Field Mapping Detected! Both & lt; Child class field & gt; And & lt; Parent class field & gt; Map for the same field name & lt; Field name & gt; Disagree using the @DocumentField Annotation!
I am hiding a field in the children category and it is causing the problem. But it is necessary for me to hide the declared field in Superclass. I can not get anywhere in the @DocumentField annotation. How can I move here? Is there any other solution?
I think there is an error in its exception. Instead, you need to use @Field
and specify a different name for the parameter:
public class guardian {personal string myField; } @Document (collection = "children") Public Class Child Parents {@Field ("childField") Private String Myfild; }
Comments
Post a Comment