Hi I have structure called problem which internally has chapter, chapter has DBref to BookEdition and BookEdition has DBRef to Book
Problem {
String name,
@DBRef
Chapter chapter;
}
Chapter {
String name,
@DBRef
BookEdition edition;
}
BookEdition {
String name,
Book book;
}
if I just fetch the problem that it takes good amount of time to fetch so I just want to include the information I need using fields().include() but I am not able to find fields of DBRefed like chapter, bookedition or book
Query q = new Query().addCriteria(Criteria.where("html").ne("").ne(null)
.and("chapter.$id").ne(""));
q.fields().include("id")
.include("name")
.include("html");
Works fine but If I just want chapter id
Query q = new Query().addCriteria(Criteria.where("html").ne("").ne(null)
and("chapter.$id").ne(""));
q.fields().include("id")
.include("name")
.include("html")
.include("chapter._id")
.include("chapter.bookEdition.isbn13")
.include("chapter.$bookEdition.$editionNumber")
.include("chapter.$bookEdition.$book.subjectId")
.include("chapter.$bookEdition.$book.title");
It doesnt fetches chapter id, bookedition. I hope I am able to explain my question. Is there any ways to specify specific field of DBRef to be included ?