LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
LangGraph SDK
ClientAuthReactLoggingReact UiServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-checkpoint-redisindexRedisSavergetNextVersion
Method

getNextVersion

A multiple of a billion above current, plus a random number below a billion. Blobs are keyed by channel and version, so two branches from one checkpoint that minted the same version would share a blob: the second branch's value replaces the first's, and the first branch reads it back from then on. The version is an integer because RedisJSON returns some floats with different last digits, and the checkpoint then points at a blob key that doesn't exist. A string version throws in the base class rather than turn into NaN.

Copy
getNextVersion(current: number | undefined): number

Parameters

NameTypeDescription
current*number | undefined
View source on GitHub