Skip to content

existsById fetches entire JSON instead of using key existence check #657

@pds6196

Description

@pds6196

version- redis-om-spring:1.0.0

Currently, calling existsById(id) on a RedisDocumentRepository generates a JSON.GET $ command to check if the document exists. While this works, it fetches the entire JSON document from Redis.

Problem:
If the JSON document is large, this approach is inefficient: it unnecessarily transfers the full payload over the network to check for existence. A simple EXISTS command would be much faster and lighter.

Expected behavior:
existsById(id) should internally use EXISTS (or an equivalent lightweight check) instead of fetching the full JSON content.

Impact:

  • Reduces network overhead for large documents.
  • Improves performance for existence checks in repositories storing big JSON objects.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions