🚀Announcing Flightcontrol - Easily Deploy Blitz.js and Next.js to AWS 🚀
Back to Documentation Menu

blitz console

Alias: blitz c

Starts a Node.js REPL with your database and all your queries and mutations preloaded.

This makes it very simple to read or write to your database and run one-off commands using your queries or mutations. It's also great for testing and rapid prototype exploration.


--env-eSet app environment name. Read more.None
--only-db-dSkip preloading queries and mutations. Only load the database module.false


> blitz console

You have entered the Blitz console
Tips: - Exit by typing .exit or pressing Ctrl-D
      - Use your db like this: db.project.findMany()
      - Use your queries/mutations like this: getProjects()
✔ Loading your code

⚡ > db.question.findMany()
    id: 1,
    createdAt: 2020-06-15T15:06:14.959Z,
    updatedAt: 2020-06-15T15:06:14.959Z,
    text: "What's up?"

Idea for improving this page? Edit it on GitHub.