What is the JacksonDB equivalent of db.collection.find({},{"fieldName":1})?

140 Views Asked by At

I am new to Jackson DB. Now I know that to get the entire document list of a collection using Jackson we need to do :

COllectionClass.coll.find().toArray();

which is Jackson DB equivalent to the mongodb command :

db.collection.find()

So What is the Jackson DB equivalent of say :

db.collection.find({},{"fieldName":1, "_id":0}) 
1

There are 1 best solutions below

2
On BEST ANSWER

As given here, This might be helpful to you. (not tested)

coll.find(DBQuery.is(),//add your criteria for search here
    DBProjection.include("fieldName")).toArray();