快速入門:使用 Gremlin 主控台建立、查詢和周遊 Azure Cosmos DB 圖形資料庫Quickstart: Create, query, and traverse an Azure Cosmos DB graph database using the Gremlin console

Azure Cosmos DB 是 Microsoft 的全域分散式多模型資料庫服務。Azure Cosmos DB is Microsoft’s globally distributed multi-model database service. 您可以快速建立及查詢文件、索引鍵/值及圖形資料庫,所有這些都受惠於位於 Azure Cosmos DB 核心的全域散發和水平調整功能。You can quickly create and query document, key/value, and graph databases, all of which benefit from the global distribution and horizontal scale capabilities at the core of Azure Cosmos DB.

本快速入門示範如何使用 Azure 入口網站建立 Azure Cosmos DB Gremlin API 帳戶、資料庫和圖表 (容器),然後從 Apache TinkerPop (英文) 使用 Gremlin 主控台 (英文) 來處理Gremlin API 資料。This quickstart demonstrates how to create an Azure Cosmos DB Gremlin API account, database, and graph (container) using the Azure portal and then use the Gremlin Console from Apache TinkerPop to work with Gremlin API data. 在本教學課程中,您將建立和查詢頂點和邊緣、更新頂點屬性、查詢頂點、周遊該圖形,以及刪除頂點。In this tutorial, you create and query vertices and edges, updating a vertex property, query vertices, traverse the graph, and drop a vertex.

Apache Gremlin 主控台中的 Azure Cosmos DB

Gremlin 主控台是以 Groovy/Java 為基礎並且在 Linux、Mac 和 Windows 上執行。The Gremlin console is Groovy/Java based and runs on Linux, Mac, and Windows. 您可以從 Apache TinkerPop 網站進行下載。You can download it from the Apache TinkerPop site.

必要條件Prerequisites

您必須擁有 Azure 訂用帳戶,才能針對本快速入門建立 Azure Cosmos DB 帳戶。You need to have an Azure subscription to create an Azure Cosmos DB account for this quickstart.

如果您沒有 Azure 訂用帳戶,請在開始前建立免費帳戶If you don't have an Azure subscription, create a free account before you begin.

您也需要安裝 Gremlin 主控台You also need to install the Gremlin Console. 使用 3.2.5 版或更高版本。Use version 3.2.5 or above. (若要在 Windows 上使用 Gremlin 主控台,必須先安裝 Java 執行階段。)(To use Gremlin Console on Windows, you need to install Java Runtime.)

建立資料庫帳戶Create a database account

  1. 在新的瀏覽器視窗中,登入 Azure 入口網站In a new browser window, sign in to the Azure portal.

  2. 按一下 [建立資源] > [資料庫] > [Azure Cosmos DB] 。Click Create a resource > Databases > Azure Cosmos DB.

    Azure 入口網站的 [資料庫] 窗格

  3. 在 [建立 Azure Cosmos DB 帳戶] 頁面中,輸入新的 Azure Cosmos DB 帳戶的設定。In the Create Azure Cosmos DB Account page, enter the settings for the new Azure Cosmos DB account.

    設定Setting Value 說明Description
    訂用帳戶Subscription 您的訂用帳戶Your subscription 選取要用於此 Azure Cosmos DB 帳戶的 Azure 訂用帳戶。Select the Azure subscription that you want to use for this Azure Cosmos DB account.
    資源群組Resource Group 新建Create new

    然後輸入識別碼中所提供的同一個唯一名稱Then enter the same unique name as provided in ID
    選取 [建立新的] 。Select Create new. 然後為您的帳戶輸入新的資源群組名稱。Then enter a new resource-group name for your account. 為求簡化,請使用和識別碼相同的名稱。For simplicity, use the same name as your ID.
    帳戶名稱Account Name 輸入唯一名稱Enter a unique name 輸入唯一名稱來識別您的 Azure Cosmos DB 帳戶。Enter a unique name to identify your Azure Cosmos DB account. 因為 documents.azure.com 會附加到您所提供的識別碼以建立 URI,請使用唯一識別碼。Because documents.azure.com is appended to the ID that you provide to create your URI, use a unique ID.

    識別碼只能使用小寫字母、數字及連字號 (-) 字元。The ID can use only lowercase letters, numbers, and the hyphen (-) character. 長度必須介於 3 到 31 個字元之間。It must be between 3 and 31 characters in length.
    APIAPI Gremlin (圖形)Gremlin (graph) API 會決定要建立的帳戶類型。The API determines the type of account to create. Azure Cosmos DB 提供五個 API:Core(SQL) (適用於文件資料庫)、Gremlin (適用於圖形資料庫)、MongoDB (適用於文件資料庫)、「Azure 資料表」及 Cassandra。Azure Cosmos DB provides five APIs: Core(SQL) for document databases, Gremlin for graph databases, MongoDB for document databases, Azure Table, and Cassandra. 目前,您必須為每個 API 建立個別個帳戶。Currently, you must create a separate account for each API.

    選取 [Gremlin (圖形)] ,因為在此快速入門中,您會建立可搭配 Gremlin API 使用的資料表。Select Gremlin (graph) because in this quickstart you are creating a table that works with the Gremlin API.

    深入了解圖形 APILearn more about the Graph API.
    位置Location 選取最接近使用者的區域Select the region closest to your users 選取用來裝載 Azure Cosmos DB 帳戶的地理位置。Select a geographic location to host your Azure Cosmos DB account. 使用最接近使用者的位置,以便他們能以最快速度存取資料。Use the location that's closest to your users to give them the fastest access to the data.

    請選取 [檢閱 + 建立] 。Select Review+Create. 您可以略過 [網路] 和 [標記] 區段。You can skip the Network and Tags section.

    Azure Cosmos DB 的新帳戶刀鋒視窗

  4. 建立帳戶需要幾分鐘的時間。The account creation takes a few minutes. 等候入口網站顯示 [恭喜!已建立您的 Azure Cosmos DB 帳戶] 頁面。Wait for the portal to display the Congratulations! Your Azure Cosmos DB account was created page.

    Azure 入口網站的 [通知] 窗格

新增圖形Add a graph

您現在可以在 Azure 入口網站中使用 [資料總管] 工具,建立圖形資料庫。You can now use the Data Explorer tool in the Azure portal to create a graph database.

  1. 選取 [資料總管] > [新增圖形] 。Select Data Explorer > New Graph.

    [新增圖形] 區域會顯示在最右邊,您可能需要向右捲動才會看到。The Add Graph area is displayed on the far right, you may need to scroll right to see it.

    Azure 入口網站資料總管 [新增圖形] 頁面

  2. 在 [新增圖形] 頁面上,輸入新圖形的設定。In the Add graph page, enter the settings for the new graph.

    設定Setting 建議的值Suggested value 說明Description
    資料庫識別碼Database ID sample-databasesample-database 輸入 sample-database 作為新資料庫的名稱。Enter sample-database as the name for the new database. 資料庫名稱的長度必須介於 1 到 255 個字元,且不能包含 / \ # ? 或尾端空格。Database names must be between 1 and 255 characters, and cannot contain / \ # ? or a trailing space.
    ThroughputThroughput 400 RU400 RUs 將輸送量變更為每秒 400 個要求單位 (RU/秒)。Change the throughput to 400 request units per second (RU/s). 如果您想要降低延遲,稍後可以相應增加輸送量。If you want to reduce latency, you can scale up the throughput later.
    圖形識別碼Graph ID sample-graphsample-graph 輸入 sample-graph 作為新集合的名稱。Enter sample-graph as the name for your new collection. 圖形名稱與資料庫識別碼具有相同的字元需求。Graph names have the same character requirements as database IDs.
    資料分割索引鍵Partition Key /pk/pk 所有 Cosmos DB 帳戶都需要分割索引鍵,才能進行水準調整。All Cosmos DB accounts need a partition key to horizontally scale. 了解如何在圖表資料分割一文中選取適當的分割區索引鍵。Learn how to select an appropriate partition key in the Graph Data Partitioning article.
  3. 填妥表單後,選取 [確定] 。Once the form is filled out, select OK.

連線到您的應用程式服務Connect to your app service

  1. 啟動 Gremlin 主控台之前,請建立或修改 apache-tinkerpop-gremlin-console-3.2.5/conf 目錄中的 remote-secure.yaml 組態檔。Before starting the Gremlin Console, create or modify the remote-secure.yaml configuration file in the apache-tinkerpop-gremlin-console-3.2.5/conf directory.

  2. 填入如下表中定義的 host 、port 、username 、password 、connectionPool 和 serializer 組態︰Fill in your host, port, username, password, connectionPool, and serializer configurations as defined in the following table:

    設定Setting 建議的值Suggested value 說明Description
    主機hosts [account-name.gremlin.cosmos.azure.com][account-name.gremlin.cosmos.azure.com] 請參閱下列螢幕擷取畫面。See the following screenshot. 這是 Azure 入口網站的 [概觀] 頁面上的 Gremlin URI 值,其以方括號括住並已移除尾端的 :443/。This is the Gremlin URI value on the Overview page of the Azure portal, in square brackets, with the trailing :443/ removed.
    連接埠port 443443 設為 443。Set to 443.
    usernameusername 您的使用者名稱 Your username /dbs/<db>/colls/<coll> 表單的資源,其中 <db> 是您的資料庫名稱,而 <coll> 是您的集合名稱。The resource of the form /dbs/<db>/colls/<coll> where <db> is your database name and <coll> is your collection name.
    passwordpassword 您的主要金鑰 Your primary key 請看下方的第二個螢幕擷取畫面。See second screenshot below. 這是您的主要金鑰,可以從 Azure 入口網站 [金鑰] 頁面的 [主鑰金鑰] 方塊中擷取。This is your primary key, which you can retrieve from the Keys page of the Azure portal, in the Primary Key box. 使用方塊左側的 [複製] 按鈕來複製此值。Use the copy button on the left side of the box to copy the value.
    connectionPoolconnectionPool {enableSsl: true}{enableSsl: true} SSL 的連線集區設定。Your connection pool setting for SSL.
    序列化程式serializer { className: org.apache.tinkerpop.gremlin.{ className: org.apache.tinkerpop.gremlin.
    driver.ser.GraphSONMessageSerializerV1d0,driver.ser.GraphSONMessageSerializerV1d0,
    config: { serializeResultToString: true }}config: { serializeResultToString: true }}
    設定此值,並在貼入此值時刪除任何 \n 分行符號。Set to this value and delete any \n line breaks when pasting in the value.

    對於主機值,從 [概觀] 頁面複製 [Gremlin URI] 值:在 Azure 入口網站的 [概觀] 頁面上檢視和複製 Gremlin URI 值For the hosts value, copy the Gremlin URI value from the Overview page: View and copy the Gremlin URI value on the Overview page in the Azure portal

    對於密碼值,從 [金鑰] 頁面複製 [主要金鑰] :在 Azure 入口網站的 [金鑰] 頁面中檢視並複製主要金鑰For the password value, copy the Primary key from the Keys page: View and copy your primary key in the Azure portal, Keys page

remote-secure.yaml 檔案看起來應該像這樣:Your remote-secure.yaml file should look like this:

hosts: [your_database_server.gremlin.cosmos.azure.com] 
port: 443
username: /dbs/your_database_account/colls/your_collection
password: your_primary_key
connectionPool: {
  enableSsl: true
}
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, config: { serializeResultToString: true }}

請務必將主機參數的值放在括號 [] 內。make sure to wrap the value of hosts parameter within brackets [].

  1. 在您的終端機執行 bin/gremlin.batbin/gremlin.sh,以啟動 Gremlin 主控台In your terminal, run bin/gremlin.bat or bin/gremlin.sh to start the Gremlin Console.

  2. 在您的終端機執行 :remote connect tinkerpop.server conf/remote-secure.yaml,以連線到您的應用程式服務。In your terminal, run :remote connect tinkerpop.server conf/remote-secure.yaml to connect to your app service.

    提示

    如果您收到 No appenders could be found for logger 錯誤,確定您如步驟 2 所述更新了 remote-secure.yaml 檔案中的序列化程式值。If you receive the error No appenders could be found for logger ensure that you updated the serializer value in the remote-secure.yaml file as described in step 2.

  3. 接下來,執行 :remote console 以將所有主控台命令重新導向至遠端伺服器。Next run :remote console to redirect all console commands to the remote server.

    注意

    如果您不執行 :remote console 命令,但想要將所有主控台命令重新導向至遠端伺服器,則應在命令前面加上 :> 前置詞,例如,您應以 :> g.V().count() 的形式執行此命令。If you don't run the :remote console command but would like to redirect all console commands to the remote server, you should prefix the command with :>, for example you should run the command as :> g.V().count(). 此前置詞是命令的一部分,在搭配使用 Gremlin 主控台與 Azure Cosmos DB 時務必要使用。This prefix is a part of the command and it is important when using the Gremlin console with Azure Cosmos DB. 省略此前置詞會指示主控台在本機執行命令,通常是針對記憶體中的圖形。Omitting this prefix instructs the console to execute the command locally, often against an in-memory graph. 使用此前置詞 :> 會指示主控台要執行遠端命令,在此案例中是針對 Azure Cosmos DB (localhost 模擬器或 Azure 執行個體)。Using this prefix :> tells the console to execute a remote command, in this case against Azure Cosmos DB (either the localhost emulator, or an Azure instance).

太棒了!Great! 現在已完成安裝程式,讓我們開始執行一些主控台命令。Now that we finished the setup, let's start running some console commands.

我們來試試簡單的 count() 命令。Let's try a simple count() command. 在提示字元中,將下列內容輸入到主控台:Type the following into the console at the prompt:

g.V().count()

建立頂點和邊緣Create vertices and edges

首先我們會新增五個人員頂點 Thomas 、Mary Kay 、Robin 、Ben 和 Jack 。Let's begin by adding five person vertices for Thomas, Mary Kay, Robin, Ben, and Jack.

輸入 (Thomas):Input (Thomas):

g.addV('person').property('firstName', 'Thomas').property('lastName', 'Andersen').property('age', 44).property('userid', 1).property('pk', 'pk')

輸出:Output:

==>[id:796cdccc-2acd-4e58-a324-91d6f6f5ed6d,label:person,type:vertex,properties:[firstName:[[id:f02a749f-b67c-4016-850e-910242d68953,value:Thomas]],lastName:[[id:f5fa3126-8818-4fda-88b0-9bb55145ce5c,value:Andersen]],age:[[id:f6390f9c-e563-433e-acbf-25627628016e,value:44]],userid:[[id:796cdccc-2acd-4e58-a324-91d6f6f5ed6d|userid,value:1]]]]

輸入 (Mary Kay):Input (Mary Kay):

g.addV('person').property('firstName', 'Mary Kay').property('lastName', 'Andersen').property('age', 39).property('userid', 2).property('pk', 'pk')

輸出:Output:

==>[id:0ac9be25-a476-4a30-8da8-e79f0119ea5e,label:person,type:vertex,properties:[firstName:[[id:ea0604f8-14ee-4513-a48a-1734a1f28dc0,value:Mary Kay]],lastName:[[id:86d3bba5-fd60-4856-9396-c195ef7d7f4b,value:Andersen]],age:[[id:bc81b78d-30c4-4e03-8f40-50f72eb5f6da,value:39]],userid:[[id:0ac9be25-a476-4a30-8da8-e79f0119ea5e|userid,value:2]]]]

輸入 (Robin):Input (Robin):

g.addV('person').property('firstName', 'Robin').property('lastName', 'Wakefield').property('userid', 3).property('pk', 'pk')

輸出:Output:

==>[id:8dc14d6a-8683-4a54-8d74-7eef1fb43a3e,label:person,type:vertex,properties:[firstName:[[id:ec65f078-7a43-4cbe-bc06-e50f2640dc4e,value:Robin]],lastName:[[id:a3937d07-0e88-45d3-a442-26fcdfb042ce,value:Wakefield]],userid:[[id:8dc14d6a-8683-4a54-8d74-7eef1fb43a3e|userid,value:3]]]]

輸入 (Ben):Input (Ben):

g.addV('person').property('firstName', 'Ben').property('lastName', 'Miller').property('userid', 4).property('pk', 'pk')

輸出:Output:

==>[id:ee86b670-4d24-4966-9a39-30529284b66f,label:person,type:vertex,properties:[firstName:[[id:a632469b-30fc-4157-840c-b80260871e9a,value:Ben]],lastName:[[id:4a08d307-0719-47c6-84ae-1b0b06630928,value:Miller]],userid:[[id:ee86b670-4d24-4966-9a39-30529284b66f|userid,value:4]]]]

輸入 (Jack):Input (Jack):

g.addV('person').property('firstName', 'Jack').property('lastName', 'Connor').property('userid', 5).property('pk', 'pk')

輸出:Output:

==>[id:4c835f2a-ea5b-43bb-9b6b-215488ad8469,label:person,type:vertex,properties:[firstName:[[id:4250824e-4b72-417f-af98-8034aa15559f,value:Jack]],lastName:[[id:44c1d5e1-a831-480a-bf94-5167d133549e,value:Connor]],userid:[[id:4c835f2a-ea5b-43bb-9b6b-215488ad8469|userid,value:5]]]]

接下來,我們會新增人員之間關聯性的邊緣。Next, let's add edges for relationships between our people.

輸入 (Thomas -> Mary Kay):Input (Thomas -> Mary Kay):

g.V().hasLabel('person').has('firstName', 'Thomas').addE('knows').to(g.V().hasLabel('person').has('firstName', 'Mary Kay'))

輸出:Output:

==>[id:c12bf9fb-96a1-4cb7-a3f8-431e196e702f,label:knows,type:edge,inVLabel:person,outVLabel:person,inV:0d1fa428-780c-49a5-bd3a-a68d96391d5c,outV:1ce821c6-aa3d-4170-a0b7-d14d2a4d18c3]

輸入 (Thomas -> Robin):Input (Thomas -> Robin):

g.V().hasLabel('person').has('firstName', 'Thomas').addE('knows').to(g.V().hasLabel('person').has('firstName', 'Robin'))

輸出:Output:

==>[id:58319bdd-1d3e-4f17-a106-0ddf18719d15,label:knows,type:edge,inVLabel:person,outVLabel:person,inV:3e324073-ccfc-4ae1-8675-d450858ca116,outV:1ce821c6-aa3d-4170-a0b7-d14d2a4d18c3]

輸入 (Robin -> Ben):Input (Robin -> Ben):

g.V().hasLabel('person').has('firstName', 'Robin').addE('knows').to(g.V().hasLabel('person').has('firstName', 'Ben'))

輸出:Output:

==>[id:889c4d3c-549e-4d35-bc21-a3d1bfa11e00,label:knows,type:edge,inVLabel:person,outVLabel:person,inV:40fd641d-546e-412a-abcc-58fe53891aab,outV:3e324073-ccfc-4ae1-8675-d450858ca116]

更新頂點Update a vertex

我們會以新的年齡 45 更新 Thomas 頂點。Let's update the Thomas vertex with a new age of 45.

輸入:Input:

g.V().hasLabel('person').has('firstName', 'Thomas').property('age', 45)

輸出:Output:

==>[id:ae36f938-210e-445a-92df-519f2b64c8ec,label:person,type:vertex,properties:[firstName:[[id:872090b6-6a77-456a-9a55-a59141d4ebc2,value:Thomas]],lastName:[[id:7ee7a39a-a414-4127-89b4-870bc4ef99f3,value:Andersen]],age:[[id:a2a75d5a-ae70-4095-806d-a35abcbfe71d,value:45]]]]

查詢圖形Query your graph

現在,我們會對您的圖形執行各種查詢。Now, let's run a variety of queries against your graph.

首先,我們會使用篩選條件嘗試查詢,只傳回超過 40 歲的人員。First, let's try a query with a filter to return only people who are older than 40 years old.

輸入 (篩選查詢)︰Input (filter query):

g.V().hasLabel('person').has('age', gt(40))

輸出:Output:

==>[id:ae36f938-210e-445a-92df-519f2b64c8ec,label:person,type:vertex,properties:[firstName:[[id:872090b6-6a77-456a-9a55-a59141d4ebc2,value:Thomas]],lastName:[[id:7ee7a39a-a414-4127-89b4-870bc4ef99f3,value:Andersen]],age:[[id:a2a75d5a-ae70-4095-806d-a35abcbfe71d,value:45]]]]

接下來,我們會預測超過 40 歲的第一個人員名稱。Next, let's project the first name for the people who are older than 40 years old.

輸入 (篩選 + 預測查詢):Input (filter + projection query):

g.V().hasLabel('person').has('age', gt(40)).values('firstName')

輸出:Output:

==>Thomas

查詢圖形Traverse your graph

我們會周遊圖形,以傳回 Thomas 的所有朋友。Let's traverse the graph to return all of Thomas's friends.

輸入 (Thomas 的朋友):Input (friends of Thomas):

g.V().hasLabel('person').has('firstName', 'Thomas').outE('knows').inV().hasLabel('person')

輸出:Output:

==>[id:f04bc00b-cb56-46c4-a3bb-a5870c42f7ff,label:person,type:vertex,properties:[firstName:[[id:14feedec-b070-444e-b544-62be15c7167c,value:Mary Kay]],lastName:[[id:107ab421-7208-45d4-b969-bbc54481992a,value:Andersen]],age:[[id:4b08d6e4-58f5-45df-8e69-6b790b692e0a,value:39]]]]
==>[id:91605c63-4988-4b60-9a30-5144719ae326,label:person,type:vertex,properties:[firstName:[[id:f760e0e6-652a-481a-92b0-1767d9bf372e,value:Robin]],lastName:[[id:352a4caa-bad6-47e3-a7dc-90ff342cf870,value:Wakefield]]]]

接下來,我們會取得下一層的頂點。Next, let's get the next layer of vertices. 周遊圖形,以傳回 Thomas 朋友的所有朋友。Traverse the graph to return all the friends of Thomas's friends.

輸入 (Thomas 朋友的朋友):Input (friends of friends of Thomas):

g.V().hasLabel('person').has('firstName', 'Thomas').outE('knows').inV().hasLabel('person').outE('knows').inV().hasLabel('person')

輸出:Output:

==>[id:a801a0cb-ee85-44ee-a502-271685ef212e,label:person,type:vertex,properties:[firstName:[[id:b9489902-d29a-4673-8c09-c2b3fe7f8b94,value:Ben]],lastName:[[id:e084f933-9a4b-4dbc-8273-f0171265cf1d,value:Miller]]]]

刪除頂點Drop a vertex

我們現在會從圖形資料庫中刪除頂點。Let's now delete a vertex from the graph database.

輸入 (置放 Jack 頂點):Input (drop Jack vertex):

g.V().hasLabel('person').has('firstName', 'Jack').drop()

清除圖形Clear your graph

最後,我們會清除所有頂點和邊緣的資料庫。Finally, let's clear the database of all vertices and edges.

輸入:Input:

g.E().drop()
g.V().drop()

恭喜!Congratulations! 您已經完成此 Azure Cosmos DB:Gremlin API 教學課程!You've completed this Azure Cosmos DB: Gremlin API tutorial!

在 Azure 入口網站中檢閱 SLAReview SLAs in the Azure portal

Azure 入口網站會監視您的 Cosmos DB 帳戶輸送量、儲存體、可用性、延遲和一致性。The Azure portal monitors your Cosmos DB account throughput, storage, availability, latency, and consistency. Azure Cosmos DB 服務等級協定 (SLA) 相關聯的計量圖表會顯示相較於實際效能的 SLA 值。Charts for metrics associated with an Azure Cosmos DB Service Level Agreement (SLA) show the SLA value compared to actual performance. 此計量套件可讓您以更透明的方式監視監視 SLA。This suite of metrics makes monitoring your SLAs transparent.

若要檢閱計量和 SLA:To review metrics and SLAs:

  1. 在您的 Cosmos DB 帳戶導覽功能表中,選取 [計量] 。Select Metrics in your Cosmos DB account's navigation menu.

  2. 選取一個索引標籤 (例如 [延遲] ),並在右側選取時間範圍。Select a tab such as Latency, and select a timeframe on the right. 比較圖表中的實際SLA 的資料行。Compare the Actual and SLA lines on the charts.

    Azure Cosmos DB 計量套件

  3. 檢閱其他索引標籤中的計量。Review the metrics on the other tabs.

清除資源Clean up resources

完成您的 Web 應用程式和 Azure Cosmos DB 帳戶之後,您可以將建立的 Azure 資源刪除,以免產生更多費用。When you're done with your web app and Azure Cosmos DB account, you can delete the Azure resources you created so you don't incur more charges. 若要刪除資源:To delete the resources:

  1. 在 Azure 入口網站中,選取最左邊的 [資源群組] 。In the Azure portal, select Resource groups on the far left. 若已摺疊左側功能表,請選取展開按鈕加以展開。If the left menu is collapsed, select Expand button to expand it.

  2. 選取您在本快速入門中建立的資源群組。Select the resource group you created for this quickstart.

    Azure 入口網站中的計量

  3. 在新視窗中,選取 [刪除資源群組] 。In the new window, select Delete resource group.

    Azure 入口網站中的計量

  4. 在下個視窗中輸入要刪除的資源群組名稱,然後選取 [刪除] 。In the next window, enter the name of the resource group to delete, and then select Delete.

後續步驟Next steps

在本快速入門中,您已了解如何建立 Azure Cosmos DB 帳戶、如何使用 [資料總管] 來建立圖形、如何建立頂點和邊緣,以及如何使用 Gremlin 主控台來周遊圖形。In this quickstart, you've learned how to create an Azure Cosmos DB account, create a graph using the Data Explorer, create vertices and edges, and traverse your graph using the Gremlin console. 您現在可以使用 Gremlin 來建置更複雜的查詢和實作強大的圖形周遊邏輯。You can now build more complex queries and implement powerful graph traversal logic using Gremlin.