content/commands/vsetattr.md
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.
VSETATTR key element "{\"type\": \"fruit\", \"color\": \"red\"}"
To remove attributes, pass an empty JSON string:
VSETATTR key element ""
is the name of the key that holds the vector set.
</details> <details open> <summary><code>element</code></summary>is the name of the element whose attributes you want to set or remove.
</details> <details open> <summary><code>json</code></summary>is a valid JSON string. Use an empty string ("") to delete the attributes.
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | |
{{< multitabs id="vsetattr-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
-tab-sep-
One of the following:
{{< /multitabs >}}