1

我想运行 OLAP 查询。我为 OLTP 查询使用 datastax node.js 驱动程序。如何使用 node.js 运行 OLAP?

http://www.datastax.com/dev/blog/nodejs-driver-for-datastax-enterprise

4

1 回答 1

2

有几种方法可以做到这一点,但最直接的方法是在参数 of中提供一个graphSourceof 'a' 。源“a”与 DSE Graph 通信以使用 OLAP 遍历源 ( source )。queryOptionsexecuteGraph

client.executeGraph('g.V().count()', null, {graphSource: 'a'}, function (err, result) {
  // process result
});

或者,您可以定义一个ExecutionProfile可重用于执行 OLAP 查询的客户端初始化:

const client = new Client({
  contactPoints: ['127.0.0.1']
  profiles: [
    new ExecutionProfile('olap', {graphOptions: {source: 'a'}})
  ]
});

client.executeGraph('g.V().count()', null, { executionProfile: 'olap' }, function (err, result) {
});
于 2016-11-18T14:50:10.543 回答