이 페이지에서는 Google Cloud 콘솔을 사용하여 Datastore 모드의 Firestore에서 데이터를 저장하고 쿼리하는 방법을 보여줍니다.
시작하기 전에
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
계정에 Datastore 모드 인스턴스를 만드는 데 필요한 datastore.databases.create 권한이 포함된 Datastore 소유자 역할이 필요합니다.
Datastore 모드에는 활성 App Engine 애플리케이션이 필요합니다.
프로젝트에 애플리케이션이 없으면 이 빠른 시작에서 자동으로 애플리케이션을 만듭니다. 이러한 경우 appengine.applications.create 권한이 필요합니다. 프로젝트 소유자는 IAM 커스텀 역할과 함께 이 권한을 할당할 수 있습니다.
데이터베이스 만들기
새 데이터베이스 인스턴스를 만들려면 Google Cloud 콘솔에서 Datastore 섹션을 엽니다. Datastore 페이지로 이동
데이터베이스 모드를 선택합니다.
새 Firestore 데이터베이스를 만들 때 Firestore를 Native 모드로 사용할지 Datastore 모드로 사용할지 선택할 수 있습니다. 같은 프로젝트에서 두 모드를 모두 사용할 수는 없습니다.
데이터베이스 위치를 선택합니다. Datastore 모드는 멀티 리전 및 리전 위치를 지원합니다.
멀티 리전 위치는 가용성과 내구성을 극대화합니다. 리전 위치는 쓰기 지연 시간이 더 짧습니다. 위치 유형에 대한 자세한 내용은 Datastore 모드 위치를 참조하세요.
이 위치는 Google Cloud 프로젝트의 Datastore 모드 데이터베이스와 App Engine 앱 모두에 적용됩니다.
데이터베이스 만들기를 클릭합니다. 데이터베이스 초기화가 완료되면Google Cloud 콘솔에서 Datastore 항목 페이지로 이동합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eThis guide demonstrates how to use the Google Cloud console to store and query data in Firestore's Datastore mode.\u003c/p\u003e\n"],["\u003cp\u003eCreating a Datastore mode instance requires the Datastore Owner role and an active App Engine application, or the \u003ccode\u003eappengine.applications.create\u003c/code\u003e permission.\u003c/p\u003e\n"],["\u003cp\u003eDatastore mode offers multi-region or regional locations, and once set, the database location cannot be changed.\u003c/p\u003e\n"],["\u003cp\u003eData can be stored as entities with properties (name, type, value), and the guide uses a \u003ccode\u003eTask\u003c/code\u003e entity example.\u003c/p\u003e\n"],["\u003cp\u003eData in Datastore can be queried by kind or using Google Query Language (GQL), with support for filtering results based on specific criteria.\u003c/p\u003e\n"]]],[],null,["# Quickstart: Store and query data in Firestore in Datastore mode\n\nStore and query data in Firestore in Datastore mode\n===================================================\n\nThis page shows you how to store and query data in Firestore in Datastore mode using the Google Cloud console.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n If you are **not** the project owner, your account requires the\n following permissions to complete this quickstart:\n\n\n - Your account requires the [**Datastore Owner** role](/iam/docs/understanding-roles#cloud_datastore_roles) which contains the `datastore.databases.create` permission needed to create a Datastore mode instance.\n - Datastore mode requires an active App Engine application. If the project doesn't have an application, this quickstart creates one for you. In that case, you require the `appengine.applications.create` permission. The project owner can assign this permission with an [IAM custom role](/iam/docs/creating-custom-roles).\n\nCreate a database\n-----------------\n\n1. To create a new database instance, open the Datastore section\n in the Google Cloud console: \n\n [Go to the Datastore page](https://console.cloud.google.com/datastore/welcome)\n\n2. Select a database mode.\n\n When you create a new Firestore database, you have the option to use\n Firestore in either Native Mode or Datastore mode. You can't use both\n modes in the same project.\n\n Select from one of the database options:\n - **Firestore in Native Mode**\n\n Recommended for mobile and web apps. To get started with Firestore, continue in the [Firestore Quickstart](/firestore/docs/quickstart).\n - **Firestore in Datastore Mode**\n\n Recommended for app architectures with backend servers.\n\n For more guidance on selecting a database mode and for a feature-by-feature\n comparison, see\n [choosing between Native Mode and Datastore Mode](/datastore/docs/firestore-or-datastore).\n3. Select a database location. Datastore mode supports multi-region\n and regional locations.\n\n A multi-region location maximizes availability and durability. Regional\n locations offer lower write latency. To learn more about location types,\n see [Datastore mode locations](/datastore/docs/locations).\n The location applies to both Datastore mode databases and App Engine apps for\n your Google Cloud project.\n | **Warning:** Once you create your database, you cannot change the location.\n\n Click **Create database**. After your database finishes initializing, the\n Google Cloud console directs you to the Datastore Entities page.\n\nStore data\n----------\n\n1. Go to the Datastore Entities page in the Google Cloud console.\n\n [Go to the Entities page](https://console.cloud.google.com/datastore/entities/query)\n\n This page lets you store, query, update, and delete data.\n2. Click **Create entity**.\n\n3. On the **Create an entity** page, use `[default]` for **Namespace**.\n\n4. Type `Task` in the **Kind** field. Leave **Key identifier** set to the\n default value of `Numeric ID (auto-generated)`.\n\n5. Under **Properties** , use the **Add property** button to add these properties:\n\n Your creation page should now look like this:\n\n \u003cbr /\u003e\n\n6. Click **Create** . The console displays the `Task` entity that you just created.\n\nYou just stored data in your database!\n\nRun a query\n-----------\n\nDatastore mode databases support querying data by kind or by\nGoogle Query Language (GQL). The instructions below walk you through using both\nto query your database.\n\n### Run kind queries\n\n1. Click **Query by kind**.\n2. Select `Task` as the kind.\n\nThe query results show the `Task` entity that you created.\n\nNext, add a query clause to restrict the results to entities that meet specific\ncriteria:\n\n1. Click **Add query clause**.\n2. In the dropdown lists, select `WHERE`, `done`, `==`, **boolean** , and **false**.\n3. Click **Run** . The results show the `Task` entity that you created since its `done` value is `false`.\n4. Now change the query clause to `WHERE`, `done`, `==`, **boolean** , and **true** . Click **Run** . The results do not include the `Task` entity that you created, because its `done` value is not `true`.\n\n### Run GQL queries\n\n1. Click **Query by GQL**.\n2. Enter `SELECT * FROM Task` as the query. Note that `Task` is case sensitive.\n3. Click **Run query**.\n\nThe query results show the `Task` entity that you created.\n| **Tip**\n|\n| The GQL query editor supports autocompletion for kinds: When you\n| need to type a kind name, press Ctrl+Space to see a list of the available\n| kinds. Up to 300 alphabetically sorted kinds can appear in the list. For\n| better matches of kinds, type one or more characters.\n\nAdd a query filter to restrict the results to entities that meet\nspecific criteria:\n\n1. Run a query such as `SELECT * FROM Task WHERE done=false`. Note that `Task` and `done` are case sensitive. The results show the `Task` entity that you created, since its `done` value is `false`.\n2. Now run a query such as `SELECT * FROM Task WHERE done=true`. The results do not include the `Task` entity that you created, because its `done` value is not `true`.\n\nClean up\n--------\n\n1. Click **Query by kind** and ensure `Task` is the selected kind.\n2. Click **Clear** to remove any query clauses.\n3. Select the `Task` entity that you created.\n4. Click **Delete** , and then confirm you want to delete the `Task` entity. Depending on the size of the browser window, **Delete** might be under the more_vert **More actions** menu. Once deleted, the entity is permanently removed from your database.\n\nThat's it, you completed this quickstart!\n\nWhat's next\n-----------\n\n- Learn more about [Datastore Queries](/datastore/docs/concepts/queries).\n- Learn more about [Datastore mode](/datastore/docs) databases.\n\n\u003cbr /\u003e"]]