You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ONGDB Enterprise 1.0.5适配的Bolt版本咨询及驱动报错问题

ONGDB Enterprise 1.0.5 对应的 Bolt 版本及驱动适配方案

ONGDB Enterprise 1.0.5 适配的 Bolt 协议版本是 3.0。

你碰到的错误是因为Go驱动默认发起了多个Bolt版本协商请求,但服务端仅支持3.0版本(可能存在协商逻辑的兼容问题)。直接指定驱动使用Bolt 3.0即可解决:

  • 初始化驱动时显式限定Bolt版本为3.0
  • 代码示例:
import (
    "time"
    "github.com/neo4j/neo4j-go-driver/v4/neo4j"
    "github.com/neo4j/neo4j-go-driver/v4/bolt"
)

func main() {
    driver, err := neo4j.NewDriver("bolt://your-ongdb-address:7687", neo4j.BasicAuth("username", "password", ""), 
        func(c *neo4j.Config) {
            c.MaxTransactionRetryTime = 30 * time.Second
            // 强制指定仅使用Bolt 3.0协议
            c.BoltVersions = []bolt.ProtocolVersion{{Major: 3, Minor: 0}}
        })
    if err != nil {
        // 处理错误
    }
    defer driver.Close()
}

另外建议使用Neo4j Go驱动v1.8.x版本,这个版本对低版本Bolt协议的兼容性更稳定。

内容的提问来源于stack exchange,提问作者Jack Riley

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 03:22:31