Write MQL with Gemini assistanceStay organized with collectionsSave and categorize content based on your preferences.
This document describes how you can useGemini Code Assistto get AI-powered
assistance inCloud Firestoreto generate MQL queries using natural language prompts.
To get the permissions that you need to complete the tasks in this document,
ask your administrator to grant you theGeminiforGoogle CloudUser(roles/cloudaicompanion.user)
IAM role on the project.
Generate MQL queries using natural language prompts
You can giveGemininatural language comments (orprompts) to
generate queries that are based on your schema. For example, you can promptGeminito generate MQL in response to the following prompts:
"How many popular books with publication year 1960?"
"Create a sample collection of popular books."
To generate MQL inCloud FirestorewithGeminiassistance, follow these steps:
In the Google Cloud console, go to theCloud FirestoreDatabasespage.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-04-10 UTC."],[],[]]