content/commands/geosearchstore.md
{{< note >}} This command's behavior varies in clustered Redis environments. See the [multi-key operations]({{< relref "/develop/using-commands/multi-key-operations" >}}) page for more information. {{< /note >}}
This command is like [GEOSEARCH]({{< relref "/commands/geosearch" >}}), but stores the result in destination key.
This command replaces the now deprecated [GEORADIUS]({{< relref "/commands/georadius" >}}) and [GEORADIUSBYMEMBER]({{< relref "/commands/georadiusbymember" >}}).
By default, it stores the results in the destination sorted set with their geospatial information.
When using the STOREDIST option, the command stores the items in a sorted set populated with their distance from the center of the circle or box, as a floating-point number, in the same unit specified for that shape.
{{% redis-cli %}} GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania" GEOADD Sicily 12.758489 38.788135 "edge1" 17.241510 38.788135 "edge2" GEOSEARCHSTORE key1 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 GEOSEARCH key1 FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST WITHHASH GEOSEARCHSTORE key2 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST ZRANGE key2 0 -1 WITHSCORES {{% /redis-cli %}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="geosearchstore-return-info" tab1="RESP2" tab2="RESP3" >}}
Integer reply: the number of elements in the resulting set
-tab-sep-
Integer reply: the number of elements in the resulting set
{{< /multitabs >}}