I'm creating a Spring Boot application and I am using AngularJS on the frontend.
Upon submitting a form with the appropiate parameters, Spring is supposed to use bookRepository.save()
method in order to save the provided data in the MongoDB. The problem is, this action gets carried on, but the structure of my model is not respected.
@Document(collection = "books")
public class Book {
private String id;
private String title;
private String author;
private String description;
private String cover;
// Getters and setters below.
}
The final outcome after following the above process: instead of having a record following the above structure inserted in MongoDB, I only end up with a field containing _id
and _class
.
Any ideas as to why is this happening?