# Waiting for the Database: async, await and try/catch

A database takes a moment to answer, so code that asks it gets a promise instead of the answer, and this lesson shows how await waits for the answer inside an async function, how try and catch handle a database that fails, and what happens when an await is missing.

![Cheat sheet: Waiting for the Database: async, await and try/catch](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/2317a8bedac44bcabd1d022c60f56df5.webp)

- Category: MongoDB
- Level: Apprentice
- Tags: async Function, Asynchronous Code, await, catch Block, JavaScript, Promise, try Block
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/mongodb-javascript-you-need-async-await-cheat-sheet
