mongodb nodejs square cube evaluator throwing超出最大调用堆栈大小

pcww981p  于 2023-04-05  发布在  Go
关注(0)|答案(2)|浏览(122)

客户端使用websockets连接到nodejs托管的cube evaluator
当限制设置为超过900时,服务器将崩溃,并出现以下错误:

// Copyright Joyent, Inc. and other Node contributors.
^
RangeError: Maximum call stack size exceeded

代码直接从网站getting started guide I.e.复制

客户

var socket = new WebSocket("ws://nodeserver/1.0/event/get");

socket.onopen = startReceiving;

function startReceiving() {
    var yesterday = new Date();
    yesterday.setDate(yesterday.getDate() - 1);
    var startDate = yesterday.getTime();

            socket.send(JSON.stringify({
                "expression": "some_event(param1,param2,param3,param4).eq(param1,'SomeValue')",
                "start": startDate,
                limit: 20000
            }));

            socket.send(JSON.stringify({
                "expression": "someother_event(param1,param2,param3,param4).eq(param1,'SomeOtherValue')",
                "start": startDate,
                limit: 20000
            }));

}

socket.onmessage = function (message) {
    var event = JSON.parse(message.data);
    // Do something with event
};

服务器端

var cube = require("cube");
var appConfig = require('./server.config.js');

var evaluatorOptions = appConfig.evaluatorOptions;

var registerServer = function(options, cubeSubject) {
    var server = cube.server(options);
    server.register = function(db, endpoints) {
        cubeSubject.register(db, endpoints);
    };
    server.start();
};

registerServer(evaluatorOptions, cube.evaluator);

有人能指出我做错了什么吗?

jhdbpxl9

jhdbpxl91#

获取最新版本的多维数据集库解决了上述问题。

bmp9r5qi

bmp9r5qi2#

在我的例子中,递归是由一个rollopJoin在它自己的rollups数组中引用引起的。

myCombinedRollup: {
    type: `rollupJoin`,
    rollups: [ OtherCube.someRollup, CUBE.myCombinedRollup ],
    //...
}

一旦我将其更改为引用另一个汇总,我就得到了一个不同的错误:)

myCombinedRollup: {
    type: `rollupJoin`,
    rollups: [ OtherCube.someRollup, CUBE.differentRollup ],
    //...
}

相关问题