簡體   English   中英

Azure CosmosDB(Gremlin API),如何使用Gremlin.Net進行連接

[英]Azure CosmosDB (Gremlin API), How to connect using Gremlin.Net

我正在嘗試使用Gremlin.Net NuGet包連接到Azure CosmosDB(Gremlin API),使用包https://www.nuget.org/packages/Gremlin.Net

GremlinClient

在Azure門戶上,我可以獲取密鑰 (用於CosmosDB客戶端NuGet包:Microsoft.Azure.DocumentDB和Microsoft.Azure.Graphs)

在此輸入圖像描述

如何獲取ssl,端口, 用戶名密碼憑據以連接到Azure CosmosDB(Gremlin API)以在Gremlin.Net NuGet包上使用?

既然你要連接的小鬼服務器的公共端口,你可以使用相同的信息,他們表現出的文檔,以通過小鬼控制台連接在這里

hosts: [your_database_server.gremlin.cosmosdb.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.GraphSONMessageSerializerV1d0, config: { serializeResultToString: true }}

我能夠使用以下行連接:

        var gremlinServer = new GremlinServer("XXX.graphs.azure.com", 443, true, "/dbs/your_database_account/colls/your_collection",
            "password");

此外,如果您使用的是.NET和Cosmos,那么Microsoft提供的名為Microsoft.Azure.Graphs的NuGet軟件包目前處於預覽狀態。

Azure Cosmos DB團隊宣布他們不再投資任何Microsoft.Azure.Graphs版本的進一步版本。 沒有人進一步進入 - 預覽階段。 Microsoft.Azure.Graphs 0.3.1中的一些錯誤也報告了關於浮點十進制轉換的預測 - 例如,您可以在緯度和經度轉換中找到。 負( - )連字符在轉換中丟失... Azure Cosmos DB團隊現在強烈建議從現在開始使用Gremlin.Net。 如前所述,Azure Cosmos DB中使用的Gremlin.Net選項在此階段不支持字節碼流,所以我想我們應該耐心並給跑步者一個機會😉同時,你仍然可以看看以下鏈接有關如何將Gremlin.Net與Azure Cosmos DB Graph API一起使用的鏈接

http://alexdrenea.com/2018/01/10/cosmosdb-graph-using-gremlin-net/

http://alexdrenea.com/2018/01/12/cosmosdb-with-gremlin-net-part-2/

https://github.com/Azure/azure-documentdb-dotnet/issues/439

就目前而言,您可以在理論上使用.net驅動程序連接到Cosmos,但即使可以,也無法遍歷圖形,因為Cosmos目前不支持字節碼流。

他們試圖在今年上半年把它搞定,但是在我寫這篇文章的時候,github問題有點安靜。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM