# Ways to check in an entry in DB is present, with ID

**URL:** <https://community.pinecone.io/t/ways-to-check-in-an-entry-in-db-is-present-with-id/7966>\
**Category:** General\
**Tags:** serverless\
**Created:** [May 8, 2025, 7:28pm UTC](https://community.pinecone.io/t/ways-to-check-in-an-entry-in-db-is-present-with-id/7966 "2025-05-08T19:28:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jocelyn](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/jocelyn/32/1653_2.png) [@jocelyn](https://community.pinecone.io/u/jocelyn)\
**Post date:** [May 8, 2025, 7:28pm UTC](https://community.pinecone.io/t/ways-to-check-in-an-entry-in-db-is-present-with-id/7966/1 "2025-05-08T19:28:57Z")

</div>

Received this question from a community member, and asnwering it here to help anyone else wondering the same thing

**Question:**

> Is there a way to check if an entry in db is present with id ? E.g i upserted an entry with id = 1 with its vectors and some metadata. Now next time when I run my code I want to check if the id is present or not. If present I want to skip the upsert . I do not want to do a vector similarities check . .

---

<div class="post-metadata">

**Author:** ![jocelyn](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/jocelyn/32/1653_2.png) [@jocelyn](https://community.pinecone.io/u/jocelyn)\
**Post date:** [May 8, 2025, 7:31pm UTC](https://community.pinecone.io/t/ways-to-check-in-an-entry-in-db-is-present-with-id/7966/2 "2025-05-08T19:31:27Z")

</div>

**Answer**

Yes!

For serverless indexes, just use the `list` operation to check if specific IDs exist in your index[1](https://docs.pinecone.io/reference/api/2025-01/data-plane/list).

python SDK 👇

```auto
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key='YOUR_API_KEY')index = pc.Index(host="INDEX_HOST")
# List IDs with a specific prefixfor ids in index.list(prefix="1", namespace="example-namespace"): print(ids)

```

The `list` operation returns up to 100 IDs at a time by default in sorted order.  
Then, you can compare your ID against the returned list to check if it exists before performing an upsert.

Note: The `list` operation is supported only for serverless indexes. If you need this functionality for pod-based indexes, you would need to explore alternative approaches. This is only an issue for a small subset of users, but good to be aware of

Hope that helps!

---

<div class="post-metadata">

**Author:** ![perry](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/perry/32/1729_2.png) [@perry](https://community.pinecone.io/u/perry)\
**Post date:** [May 13, 2025, 9:18am UTC](https://community.pinecone.io/t/ways-to-check-in-an-entry-in-db-is-present-with-id/7966/3 "2025-05-13T09:18:56Z")

</div>

You could also use `fetch` to retrieve one or more vectors by their specific ID: [Fetch records - Pinecone Docs](https://docs.pinecone.io/guides/manage-data/fetch-data)
