{
  "id": "collect",
  "title": "Collect",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/collect/",
  "summary": "Collects all records to the origin shard.",
  "tags": [
    "docs",
    "operate",
    "stack"
  ],
  "last_updated": "2026-04-22T11:55:45+02:00",
  "page_type": "content",
  "content_hash": "33daa573544e8ed1adbe23d4e9c8113537be14ba21d8f217b7773c8b6632cf9a",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "[code example]\n\nCollects all of the records to the shard where the RedisGears job started."
    },
    {
      "id": "parameters",
      "title": "Parameters",
      "role": "parameters",
      "text": "None"
    },
    {
      "id": "returns",
      "title": "Returns",
      "role": "returns",
      "text": "Returns a GearsBuilder object with the same template type as the input builder."
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "java",
      "code": "public GearsBuilder<T> collect()",
      "section_id": "overview"
    },
    {
      "id": "example-ex0",
      "language": "java",
      "code": "GearsBuilder.CreateGearsBuilder(reader).collect();",
      "section_id": "example"
    }
  ]
}
