我有一个Xamain应用程序,该应用程序使用了文档API和图形API的Azure cosmos db。
为避免付费(家庭用户花费很多),我使用了“ Azure Cosmos DB仿真器”,但它仅支持文档数据库!
那么,是否有一些解决方案可以让我在本地使用与Azure Graph API兼容的本地Graph数据库?
谢谢
答案 0 :(得分:3)
我们计划在Microsoft Ignite会议上发布的仿真器版本将支持所有Cosmos DB API,包括Graph API。请注意此版本。
答案 1 :(得分:0)
发件人:Microsoft Doc和apache-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()
您可以通过模拟器使用它,但您不应具有任何资源管理器视图