首页 > 解决方案 > 没有为 null 类型定义协议方法 IDeref.-deref

问题描述

我有一个fluree数据库,这是一个好的数据库吗?我有这个问题,虽然我不知道出了什么问题,但似乎已经按照文档https://docs.flur.ee/tools/nodejs/nodejs-examples#connect所做的那样,但是会发生类似这样的错误

const flureenjs = require('@fluree/flureenjs');

const flureeServerUrl = 'http://localhost:8080';
const optionss = { keepAlive: true };

let flureeDbConn;

function flureeConnect(url, options) {
    let cOpts = {};
  if (options && options.keepAlive && options.keepAlive === true) {
    cOpts = {
      'keep-alive-fn': function() {
        flureeConnect(url, options);
      }
    };
  }

  flureenjs.connect_p(url, cOpts)
    .then((conn) => {
        flureeDbConn=conn;
        console.log(conn);
    })
    .catch((error) => {
      console.error('Error connecting to Fluree DB', error);
      // -> gracefully shutdown
      // -> or add re-try logic
    });
}

flureeConnect(flureeServerUrl, optionss);

flureenjs.close(flureeDbConn);

标签: node.js

解决方案


推荐阅读