I am trying to upsert vectors using js.
I have an array of data, the format is this:
const arrWithVectors = [
{
id: 0,
values: [-0.0031084144, -0.03322564, -0.0049643777, -0.043764398, 0.0022145018, 0.027566899, ...],
pageContent: "This is a chunk of text from the doc I want to search on",
metadata: {loc: {lines: {from: 1, to: 5}}}},
{i
d: 1,
values: [-0.0010979653, -0.0060853898, 0.004418479, -0.024967067, 0.00074445375, 0.0122373225, ...],
pageContent: "This is the second chunk of text from the doc I want to search on",
metadata: {loc: {lines: {from: 6, to: 10}}}}
]
The code I am using to upsert:
const client = new PineconeClient();
await client.init({
apiKey: '12345678910',
environment: 'my environment',
});
const pineconeIndex = client.Index(my pinecone index);
let pineconeResult = await pineconeIndex.upsert({
upsertRequest: {
namespace: "",
vectors: arrWithVectors
}
});
I’m not getting an error, but nothing is being inserted to the vector store.
Any ideas greatly appreciated!