Query with metadata only

Is there a way to retrieve all vectors and associated metadata from the db which meet filtering requirements without have any vector as part of the query?

Hi @tom !

Currently as per documentation, either ID or VECTOR is a mandatory value when making a query. So no. It is not currently possible to fetch all data this way. There are some workarounds posted on this forum I think, but there is no official way yet.

Hope this helps

1 Like

Hi, I have exactly the same use case here… what are the ‘workarounds’? I don’t think making a vector of N dimension of 0 is the same as ‘select *’…

Any tips please? Thanks

Just answered a similar question here:

Would be great to have an update to the fetch API to allow retrieving data by a filter and/or namespace, as it would help in managing the data vs having to always keep a separate index somewhere else of what data you’ve stored in Pinecone.

One method that worked for me was providing an empty n-long query. So for example, if I had a 1536 dimensional namespace I would include my filters and then for vectors has a 1536 long array of all zeros.

Im sure that it isn’t foolproof but for my purposes worked out great!

1 Like