How do you connect to a Cosmos Db (primarily updated via SQL API) using Gremlin.Net ? (can you?)

混江龙づ霸主 提交于 2021-02-10 15:56:02

问题


Im working on a Cosmos DB app that stores both standard documents and graph documents. We are saving both types via the documentdb api and I am able to run graph queries that return Graphson using the DocumentClient.CreateGremlinQuery method. This graphson is to be read by a web app and the graph displayed for user viewing and so on.

My issue is that I cannot define the version of the Graphson format returned when using the Microsoft.Azure.Graphs method. So i looked into Gremlin.net and that has a lot more options in this regard from the documentation.

However I am finding connecting to the Cosmos Document Db using gremlin.net difficult. The server variable which you define like this :

var server = new GremlinServer("https://localhost/",8081 , enableSsl: true, username: $"/dbs/TheDatabase/colls/TheCOllection", password: "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==");

then results in a uri that has "/gremlin" and it cannot locate the database end point.

Has anyone used Gremlin.net to connect to a Cosmos document database (not a Cosmos db configured as a graph db) that has been setup as a document db not a graph db ? The documents in it are graph/gremlin compatible in their format with _isEdge / label / _sink etc.

Cheers,

Mark (Document db/Gremlin/graph newbie)

来源:https://stackoverflow.com/questions/51779501/how-do-you-connect-to-a-cosmos-db-primarily-updated-via-sql-api-using-gremlin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!