【问题标题】:No Cosmos DB Graph database Emulator没有 Cosmos DB 图形数据库模拟器
【发布时间】:2018-09-11 17:21:25
【问题描述】:

我有一个使用 Azure cosmos db 的 Xamain 应用程序,包括文档 API 和图形 API。

为了避免付费(对于家庭用户来说成本很高),我使用“Azure Cosmos DB Emulator”,但它只支持文档数据库!

那么,是否有一些解决方案可以让我在本地使用与 Azure Graph API 兼容的本地 Graph 数据库?

谢谢

【问题讨论】:

    标签: azure xamarin azure-cosmosdb graph-databases


    【解决方案1】:

    我们为 Microsoft Ignite 会议计划的模拟器版本将支持所有 Cosmos DB API,包括图形 API。请留意此版本。

    【讨论】:

    • 嗨大卫,我已经下载并安装了最新版本,但我找不到使用 Graph API 的方法。正常吗?谢谢
    • 我在 MS 网站上看到,他们更新了页面并声称我们可以使用 Gremlin API,但我找不到任何使用它的方法。我没有找到任何说明,Azure Explorer 没有显示任何内容!看,他们声称我们可以使用 Gremlin API:docs.microsoft.com/en-us/azure/cosmos-db/local-emulator
    【解决方案2】:

    发件人:Microsoft Docapache-tinkerpop-gremlin-console-3.3.4.

    Gremlin API
    Start emulator from an administrator command prompt with "/EnableGremlinEndpoint". Alternatively you can also set the environment variable AZURE_COSMOS_EMULATOR_GREMLIN_ENDPOINT=true
    
    Install apache-tinkerpop-gremlin-console-3.3.4.
    
    In the emulator's Data Explorer create a database "db1" and a collection "coll1"; for the partition key, choose "/name"
    
    Run the following commands in a regular command prompt window:
    
    
    cd /d C:\sdk\apache-tinkerpop-gremlin-console-3.3.4-bin\apache-tinkerpop-gremlin-console-3.3.4
    
    copy /y conf\remote.yaml conf\remote-localcompute.yaml
    notepad.exe conf\remote-localcompute.yaml
      hosts: [localhost]
      port: 8901
      username: /dbs/db1/colls/coll1
      password: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
      connectionPool: {
      enableSsl: false}
      serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
      config: { serializeResultToString: true  }}
    
    bin\gremlin.bat
    In the Gremlin shell run the following commands to connect to the Gremlin endpoint:
    
    
    :remote connect tinkerpop.server conf/remote-localcompute.yaml
    :remote console
    :> g.V()
    :> g.addV('person1').property(id, '1').property('name', 'somename1')
    :> g.addV('person2').property(id, '2').property('name', 'somename2')
    :> g.V()
    

    你可以通过模拟器使用它,但你不应该有任何资源管理器视图

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-06
      • 1970-01-01
      • 2018-12-14
      • 2019-12-30
      • 2018-11-13
      • 1970-01-01
      • 2022-10-05
      • 2021-10-03
      相关资源
      最近更新 更多