속성 유형
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
속성 유형을 사용합니다.
더 살펴보기
이 코드 샘플이 포함된 자세한 문서는 다음을 참조하세요.
코드 샘플
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],[],[[["\u003cp\u003eThe provided code samples demonstrate how to define and create a "Task" entity in Datastore mode across various languages, including C#, Go, Java, Node.js, PHP, Python, and Ruby.\u003c/p\u003e\n"],["\u003cp\u003eEach language example shows setting properties such as "category," "created," "done," "priority," "percent_complete," and "description" for the "Task" entity.\u003c/p\u003e\n"],["\u003cp\u003eThe examples include instructions on how to access language-specific documentation for the Datastore mode API and client libraries.\u003c/p\u003e\n"],["\u003cp\u003eThe examples also mention setting up Application Default Credentials for authenticating to Datastore mode.\u003c/p\u003e\n"],["\u003cp\u003eA common practice across all code samples is to exclude the \u003ccode\u003edescription\u003c/code\u003e field from indexing, improving query efficiency by ensuring the data is not used in indexed queries.\u003c/p\u003e\n"]]],[],null,["# Property types\n\nUse property types.\n\nExplore further\n---------------\n\n\nFor detailed documentation that includes this code sample, see the following:\n\n- [Entities, Properties, and Keys](/datastore/docs/concepts/entities)\n- [Indexes](/datastore/docs/concepts/indexes)\n\nCode sample\n-----------\n\n### C#\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode C# API\nreference documentation](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n Entity task = new Entity()\n {\n Key = _db.CreateKeyFactory(\"Task\").CreateKey(\"sampleTask\"),\n [\"category\"] = \"Personal\",\n [\"created\"] = new DateTime(1999, 01, 01, 0, 0, 0, DateTimeKind.Utc),\n [\"done\"] = false,\n [\"priority\"] = 4,\n [\"percent_complete\"] = 10.0,\n [\"description\"] = new Value()\n {\n StringValue = \"Learn Cloud Datastore\",\n ExcludeFromIndexes = true\n },\n };\n\n### Go\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Go API\nreference documentation](https://cloud.google.com/go/docs/reference/cloud.google.com/go/datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n type Task struct {\n \tCategory string\n \tDone bool\n \tPriority int\n \tDescription string `datastore:\",noindex\"`\n \tPercentComplete float64\n \tCreated time.Time\n }\n task := &Task{\n \tCategory: \"Personal\",\n \tDone: false,\n \tPriority: 4,\n \tDescription: \"Learn Cloud Datastore\",\n \tPercentComplete: 10.0,\n \tCreated: time.Now(),\n }\n\n### Java\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Java API\nreference documentation](https://cloud.google.com/java/docs/reference/google-cloud-datastore/latest/history).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n Entity task =\n Entity.newBuilder(taskKey)\n .set(\"category\", \"Personal\")\n .set(\"created\", Timestamp.now())\n .set(\"done\", false)\n .set(\"priority\", 4)\n .set(\"percent_complete\", 10.0)\n .set(\n \"description\",\n StringValue.newBuilder(\"Learn Cloud Datastore\").setExcludeFromIndexes(true).build())\n .build();\n\n### Node.js\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Node.js API\nreference documentation](https://cloud.google.com/nodejs/docs/reference/datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n const task = [\n {\n name: 'category',\n value: 'Personal',\n },\n {\n name: 'created',\n value: new Date(),\n },\n {\n name: 'done',\n value: false,\n },\n {\n name: 'priority',\n value: 4,\n },\n {\n name: 'percent_complete',\n value: 10.0,\n },\n {\n name: 'description',\n value: 'Learn Cloud Datastore',\n excludeFromIndexes: true,\n },\n ];\n\n### PHP\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode PHP API\nreference documentation](https://googleapis.github.io/google-cloud-php/#/docs/cloud-datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n $task = $datastore-\u003eentity(\n $key,\n [\n 'category' =\u003e 'Personal',\n 'created' =\u003e new DateTime(),\n 'done' =\u003e false,\n 'priority' =\u003e 4,\n 'percent_complete' =\u003e 10.0,\n 'description' =\u003e 'Learn Cloud Datastore'\n ],\n ['excludeFromIndexes' =\u003e ['description']]\n );\n\n### Python\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Python API\nreference documentation](https://cloud.google.com/python/docs/reference/datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n from google.cloud import https://cloud.google.com/python/docs/reference/datastore/latest/\n\n # For help authenticating your client, visit\n # https://cloud.google.com/docs/authentication/getting-started\n client = https://cloud.google.com/python/docs/reference/datastore/latest/.https://cloud.google.com/python/docs/reference/datastore/latest/google.cloud.datastore.client.Client.html()\n\n import datetime\n\n key = client.https://cloud.google.com/python/docs/reference/datastore/latest/google.cloud.datastore.client.Client.html#google_cloud_datastore_client_Client_key(\"Task\")\n task = https://cloud.google.com/python/docs/reference/datastore/latest/.https://cloud.google.com/python/docs/reference/datastore/latest/google.cloud.datastore.entity.Entity.html(key, exclude_from_indexes=(\"description\",))\n task.update(\n {\n \"category\": \"Personal\",\n \"description\": \"Learn Cloud Datastore\",\n \"created\": datetime.datetime.now(tz=datetime.timezone.utc),\n \"done\": False,\n \"priority\": 4,\n \"percent_complete\": 10.5,\n }\n )\n client.https://cloud.google.com/python/docs/reference/datastore/latest/google.cloud.datastore.client.Client.html#google_cloud_datastore_client_Client_put(task)\n\n### Ruby\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Ruby API\nreference documentation](/ruby/docs/reference/google-cloud-datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n task = datastore.entity \"Task\" do |t|\n t[\"category\"] = \"Personal\"\n t[\"created\"] = Time.now\n t[\"done\"] = false\n t[\"priority\"] = 4\n t[\"percent_complete\"] = 10.0\n t[\"description\"] = \"Learn Cloud Datastore\"\n t.exclude_from_indexes! \"description\", true\n end\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=datastore)."]]