Reputation: 11
I'm using the Milvus client to insert data into a collection, but I've noticed that the IDs returned in the result are identical for every 32 inserts, with the 33rd insert returning a different ID. Is there something wrong with my code, or could this be a configuration issue?
const result = await client.insert({
collection_name: DatasetVectorTableName,
data: [
{
vector,
teamId: String(teamId),
datasetId: String(datasetId),
collectionId: String(collectionId),
createTime: Date.now()
}
]
});
console.log("result1234", result)
const insertId = (() => {
if ('int_id' in result.IDs) {
return `${result.IDs.int_id.data?.[0]}`;
}
return `${result.IDs.str_id.data?.[0]}`;
})();
return {
insertId: insertId
};
Is this code wrong?
Upvotes: 1
Views: 27