Failing to upsert

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}}}},
  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!

Hi @tom1

what is the error you are getting? :slight_smile: From your code only the pageContent: "..." bothers me, other than that other stuff looks good to me :slight_smile: Maybe try to move the pageContent to metadata as well.

Hope this helps

Hi Jasper, thanks for your reply! No error, just nothing being added to the vector store! I was also wondering about the formatting but couldn’t find anything in the docs to suggest it was faulty :thinking: Any suggestion how it should be?

Strange. Well as stated above, the upsert object doesn’t contain a definition for pageContent, so I would move that to metadata and see what happens :slight_smile: after that I would insert just a vector without any other values to see if that is working as intended (you can delete the dummy vector anytime).

Good idea! I probably should have thought of that :sweat_smile: Am gonna try that.