--- categories: - docs - develop - stack - oss - rs - rc - oss - kubernetes - clients complexity: O(1) description: Associate or remove the JSON attributes of elements. group: vector_set hidden: false linkTitle: VSETATTR railroad_diagram: /images/railroad/vsetattr.svg since: 8.0.0 summary: Associate or remove the JSON attributes of elements. syntax_fmt: "VSETATTR key element \"{ JSON obj }\"" title: VSETATTR --- Associate a JSON object with an element in a vector set. Use this command to store attributes that can be used in filtered similarity searches with `VSIM`. You can also update existing attributes or delete them by setting an empty string. ```shell VSETATTR key element "{\"type\": \"fruit\", \"color\": \"red\"}" ``` To remove attributes, pass an empty JSON string: ```shell VSETATTR key element "" ``` ## Required arguments
key is the name of the key that holds the vector set.
element is the name of the element whose attributes you want to set or remove.
json is a valid JSON string. Use an empty string (`""`) to delete the attributes.
## Related topics - [Vector sets]({{< relref "/develop/data-types/vector-sets" >}}) ## Redis Software and Redis Cloud compatibility | Redis
Software | Redis
Cloud | Notes | |:----------------------|:-----------------|:------| | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | ## Return information {{< multitabs id="vsetattr-return-info" tab1="RESP2" tab2="RESP3" >}} One of the following: * [Integer reply](../../develop/reference/protocol-spec#integers): 0 if either the key or element does not exist; 1 if the attributes were successfully added to the element. * [Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for improperly specified attribute string. -tab-sep- One of the following: * [Boolean reply](../../develop/reference/protocol-spec#booleans): false if either the key or element does not exist; true if the attributes were successfully added to the element. * [Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for improperly specified attribute string. {{< /multitabs >}}