宇宙小精灵 json 数据摄取

时间:2021-06-24 18:29:15

标签: python cypher azure-cosmosdb gremlin azure-cosmosdb-gremlinapi

Azure Cosmos Gremlins API。

假设分区键 - 除法

种系查询以添加节点

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

我如何将类似的 JSON 数据从 cosmos gremlin API 或从 python 代码插入到 cosmos 中。请检查地址是否有多行。

persondata = {
    firstName: 'Thomas',
    lastName: 'Andersen',
    age: 44,
    Address: [
        {"id": 1, "city": "city1", "comment": "something useful, I'm sure"},
        {"id": 2, "city": "city2", "comment": "wisdom from the interwebs"},
        {"id": 3, "city": "city3", "comment": "....."}
    ]

};

g.addV('person', persondata );

类似文章可用 - http://5.9.10.113/59629769/how-to-insert-data-as-json-object-with-gremlin-api-in-azure-cosmos-db

换句话说,是否可以将直接的 JSON 数据摄取到 gremlin API(SQL API - 可能)中

例如:

{
    "id": "AndersenFamily",
    "lastName": "Andersen",
    "pKey": "Andersen",
  } 

下面的 SQL APT 链接 - JSON https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-working-with-json

0 个答案:

没有答案