Not sure what you mean here - MongoDB stores JSON-style documents, which are not exactly the same as hashmaps.
The MongoDB online manuals contain lots of good advice on
how to do different kinds of queries via the MongoDB shell. This might be a good place to start as you can try out your queries directly on the database. It sounds like you simply want to limit the output to specified fields, which is a "projection".
If you are using another language e.g. Java or Python, then the relevant database driver documentation should provide examples of how to construct your query document to achieve your requirements e.g. the
MongoDB Java driver documentation includes a quick introduction.
But if I were you I'd start in the shell, so you can concentrate on getting your query right first. Once you know what your query should look like, it will be easier to build the corresponding query in Java or Python. This is a good general approach to building database queries, even on SQL databases, as it means you can focus on getting the query right, before you have to worry about how to make it work via your driver.
I would also recommend you complete one of the
free online courses from MongoDB University e.g.
M101J MongoDB for Java Developers and
M101P MongoDB for Python Developers are both starting again from today. These courses will teach you all the basics about how to work with MongoDB in your chosen language, and they're a great way to get up to speed quickly with this technology.