Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbenjoseph committed Feb 3, 2024
1 parent 769c803 commit 3d6c014
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ Usage
# Check if a key exists in the database
exists = "sample_key" in db
**Searching**

.. code-block:: python
# Search for nearest neighbors of a vector
results = db.search(vector=np.random.rand(128), k=5)
for key, vector, distance, metadata in results:
print(key, distance, metadata)
**Iterating Through Data**

Expand All @@ -61,21 +69,22 @@ Usage
for key, vector, metadata in db:
print(key, metadata)
**Deleting Data**
**Updating Data**

.. code-block:: python
# Delete a vector from the database by key
del db["sample_key"]
# Update a vector in the database
db.update_vector("sample_key", np.random.rand(128))
**Searching**
# Update metadata
db.update_metadata("sample_key", {"info": "updated metadata"})
**Deleting Data**

.. code-block:: python
# Search for nearest neighbors of a vector
results = db.search(vector=np.random.rand(128), k=5)
for key, vector, distance, metadata in results:
print(key, distance, metadata)
# Delete a vector from the database by key
del db["sample_key"]
**Database Length**

Expand Down

0 comments on commit 3d6c014

Please sign in to comment.