ArangoDB

安装与启动请参考:arangodb安装 - gaoshoufenmu - 博客园

图遍历:ArangoDB 中的Graph_Missbelover的博客-CSDN博客_arangodb graph

导入csv:

arangoimp --file "C:\Users\xxxx\Desktop\2020_en.csv" --collection line_en --create-collection true --type csv

条件查询:

FOR c IN Characters
    FILTER c.name=="Robert"
    RETURN c.name

图遍历:

for i in 1 ..3 OUTBOUND "Characters/10155" GRAPH 'test'
RETURN i.name

最短路径:

for i IN OUTBOUND SHORTEST_PATH
  'Characters/10169' TO 'Characters/10173' GRAPH 'test'
RETURN {"name":i.name,"surname":i.surname,"_id":i._id}

K条最短路径算法:

for i in  OUTBOUND K_SHORTEST_PATHS 'Characters/10169' TO 'Characters/10173' GRAPH 'test'
RETURN  
//{"name":i.name,"surname":i.surname,"_id":i._id}
i

创建view(arangosh):

c0 = db._create("ExampleCollection0");
c1 = db._create("ExampleCollection1");
 
c0.save({ i: 0, name: "full", text: "是一个 多模 型数 据库" });
c0.save({ i: 1, name: "half", text: "是一个 多模" });
c0.save({ i: 2, name: "other half", text: "型数 据库" });
c0.save({ i: 3, name: "quarter", text: "是一" });
 
c1.save({ a: "foo", b: "bar", i: 4 });
c1.save({ a: "foo", b: "baz", i: 5 });
c1.save({ a: "bar", b: "foo", i: 6 });
c1.save({ a: "baz", b: "foo", i: 7 });
v0 = db._createView("ExampleView", "arangosearch", {});

v0 = db._view("ExampleView");
v0.properties({
    links: {
      /* collection Link 0 with additional custom configuration: */
      'ExampleCollection0':
      {
        /* examine fields of all linked collections,
           using default configuration: */
        includeAllFields: true,
        fields:
        {
          /* a field to apply custom configuration
             that will index English text: */
          name:
          {
            analyzers: ["text_en"]
          },
          /* another field to apply custom configuration
             that will index Chinese text: */
          text:
          {
            analyzers: ["text_zh"]
          }
        }
      },
      /* collection Link 1 with custom configuration: */
      'ExampleCollection1':
      {
        /* examine all fields using default configuration: */
        includeAllFields: true,
        fields:
        {
          a:
          {
            /* a field to apply custom configuration
                that will index English text: */
            analyzers: ["text_en"]
          }
        }
      }
    }
  }
);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值