FAQs
What is a database search?
Are a database search and a database query the same thing?
How do you search for data in a database?
With MongoDB, you search for data in the database using the MongoDB Query API Searching for data with the Query API usually involves using the findOne, find, or aggregate methods. There are other methods, such as findOneAndUpdate, that do more than just search for data. The exact names of these methods may be different in the driver you're using because the drivers are adapted to the conventions of the programming language they're written for.
What tools can you use to search a database?
If you are writing software that needs to search a MongoDB database, you should use one of the language drivers that MongoDB provides for all popular programming languages. If you are making ad-hoc queries or building a query to insert into your code, there are a number of tools you can use to search the database:
- Mongosh is a command-line tool that allows you to write and execute queries in a JavaScript shell.
- MongoDB Compass is a GUI application that provides a useful interface for building queries, especially aggregation pipelines, for searching your database. You can also save frequently used queries so that they can be reused in the future.
- MongoDB Atlas Data Explorer is part of the MongoDB Atlas web interface and allows you to build queries and search your database in a similar way to Compass.
Get started with Atlas today
- 125+ regions worldwide
- Sample data sets
- Always-on authentication
- End-to-end encryption
- Command line tools