Guides
Reset
Sometimes, all you need is to clean everything and start over.
Our SDK provides the capability to reset your index and/or namespaces.
Reset Namespace
You can reset a namespace by calling the reset() method on the index or namespace.
If the reset() method is called on the index, only the default namespace will be reset, not the whole index.
simple
use Upstash\Vector\Index;$index = new Index( url: "<UPSTASH_VECTOR_REST_URL>", token: "<UPSTASH_VECTOR_REST_TOKEN>",);$index->reset();using namespaces
use Upstash\Vector\Index;$index = new Index( url: "<UPSTASH_VECTOR_REST_URL>", token: "<UPSTASH_VECTOR_REST_TOKEN>",);$index->namespace('my-namespace')->reset();Reset All Namespaces
To reset all namespaces, you can call the resetAll() method on the index, as shown below:
use Upstash\Vector\Index;$index = new Index( url: "<UPSTASH_VECTOR_REST_URL>", token: "<UPSTASH_VECTOR_REST_TOKEN>",);$index->resetAll();You can read more about Namespaces on our docs.