Morphia v1.3.x using Document class from Java Driver 3.4.x us

26 views
Skip to first unread message

Daniel R

unread,
Dec 4, 2017, 7:10:36 AM12/4/17
to Morphia
chapterHi, it is possible to use the Document classes from the java driver instead of the DBObject classes?
E.g. the "Raw Querying" chapter gives the following example using DBObject classes

DBObject query = BasicDBObjectBuilder.start() .add("albums", new BasicDBObject("$elemMatch", new BasicDBObject("$and", new BasicDBObject[] { new BasicDBObject("albumId", albumDto.getAlbumId()), new BasicDBObject("album", new BasicDBObject("$exists", false))}))) .get();
Artist result = datastore.createQuery(Artist.class, query).get();

But is it possible to use a Document instead of a DBObject in this case? It looks to me as if Morphia's API doesn't support this new stuff yet.


Reply all
Reply to author
Forward
0 new messages