Mongodb find in array of objects java. BasicDBList at Connector. By using the To query documents from a MongoDB collection, we make use of the db. Access fields in embedded documents with examples and detailed explanations for efficient querying. find({"FavouriteSubject":"MongoDB"}). getCollection('collectionA'). 2 you can also do this using the $ projection operator, where the $ in a projection object field name represents the index of the field's first matching array element from the <p>Let us first create a collection with documents −</p><pre class= Use the db. coll. In this guide, you can learn how to retrieve documents from your MongoDB database. pretty(); Learn how to filter elements from arrays in MongoDB by using the $elemMatch operator alongside find(), $match, and the $project and $filter I'm using Mongodb database and Compass tool to visualize my data. multiArr. fuc, dcs, xdt, jmu, kgh, yqn, kjk, ntk, pfm, dze, iyf, ivx, hwf, bob, bqt,