Replies: 6 comments 6 replies
-
Hey @thomasf1, there are several possible options:
|
Beta Was this translation helpful? Give feedback.
-
@generall Do we get a capability of auto-generated id? |
Beta Was this translation helpful? Give feedback.
-
If I understand the docs correctly, the ID field is either an integer or an UUID. I did not see an option to auto-generate an ID on insert. It´s an interesting design decision, it seems to put some unnecessary limitations on the product - especially when migrating from another DB and wanting to keep IDs or having an existing strategy for generating IDs. Pretty basic stuff in traditional DB Products... |
Beta Was this translation helpful? Give feedback.
-
That makes sense, that can be tricky/costly to implement. The choice of either Integers or UUIDs seems a bit limiting though, but I guess it is the two extremes that are easiest (either fully app/user managed sequential IDs or long ones with a low chance of collision). Would you guys consider opening up the ID field to Strings (which UUIDs basically are, too), it would be nice for a migration to use existing IDs - also for URLs UUIDs are a bit long. The problem of inserts would still need some solution though, not sure what happens currently when a numeric or UUID id already exists? The alternative of managing two sets of IDs (one Record ID and one in the payload) seems like messy though, especially when using features like recommendations which are Record ID based and would need mapping tables or something. |
Beta Was this translation helpful? Give feedback.
-
When a collection uses integer IDs, is there an efficient way to query the largest existing ID in the collection? |
Beta Was this translation helpful? Give feedback.
-
UPDATE: All things considered, this is much easier than looking up the item first, get the id/uuid, and then upserting. I wrote an article explaining this approach: https://charliegreenman.medium.com/how-to-update-an-existing-vector-in-qdrant-using-an-external-database-for-uuid-management-ec99cf5a50b1 Edit: I tried going the numerical route. It doesn't make sense as 4 billion will be the max anyways. We are working on datasets and might get there anyways. Uuid is the only approach. Therefore, in order to update, you will have search a vector a specific fields i.e. a string id, then use that to get the id to upsert. Gosh this is really tough, but the best approach at the moment Can disregard this won'' work. unint32 not large enough Nnice I just found a cool method for converting strings to numerical ids orgId abc is 10203 string as id === 10203002402502600123 0 is space between letters I'm going to write this article soon, and there should be an open source repo users can use to convert strings to ids for writes and retrievals. Takes away effort from user having to use uuid, in addition can query against id directly if need be. I am writing an open source library for this soon and report back Update: Open source repo here and I am working on: https://github.com/razroo/string-to-id |
Beta Was this translation helpful? Give feedback.
-
Sorry for this noob question, but I couldn´t find anything in the documentation.
Porting some code over from another DB, currently the IDs on an new Item (DB entries / Points) are randomly generated and in the rare case a ID already exists the code inserting it throws an exception and a new ID is assigned.
There seems to not be a insert/create function with qdrant, giving me the feeling that this not encouraged. What´s the best practise on qdrant (while keeping ID assignment in the Code / not shifting it to the DB)?
Beta Was this translation helpful? Give feedback.
All reactions