# Error upserting docs to pinecone

**URL:** https://community.pinecone.io/t/error-upserting-docs-to-pinecone/7206
**Category:** Support
**Tags:** vector-database, embeddings
**Created:** [December 20, 2024, 3:37am UTC](https://community.pinecone.io/t/error-upserting-docs-to-pinecone/7206 "2024-12-20T03:37:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hello4](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/hello4/32/3671_2.png) [@hello4](https://community.pinecone.io/u/hello4)
#### Post date: [December 20, 2024, 3:37am UTC](https://community.pinecone.io/t/error-upserting-docs-to-pinecone/7206/1 "2024-12-20T03:37:18Z")

</div>

Hi,

I am getting an error while uploading data to Pinecone. Error message: `Error upserting to Pinecone: TypeError: records.forEach is not a function`.

This is what the metadataList looks like:

```auto
 [
  {
    id: 'Using pinecone-0',
    metadata: {
      title: 'Using pinecone',
      chunkIndex: 0,
      text: '\n' +
        '\n' +
        'The work will hinge on research and information obtained through various sources to fulfil its objectives. This \n' +
        'work is only for academic purpose and the author does not claim the originality of content. \n' +
        ' CRYPTOCURRENCIES ENVIRONMENT IN USA \n' +
        '❖ Regulatory Framework for Cryptocurrencies in USA \n' +
        'Governments establish legal and procedural frameworks to influence numerous aspects of \n' +
        'digital assets, including regulations pertaining to cryptocurrency. Many jurisdictions have \n' +
        'different cryptocurrency laws, ranging from comprehensive guidelines aimed at assisting \n' +
        'blockchain users to complete prohibitions on the usage or trading of cryptocurrencies. \n' +
        'Regulations pertaining to digital assets may cover the creation, purchase, sale, and exchange \n' +
        "of digital currency. The United States' laws and regulations surrounding cryptocurrencies is \n" +
        'uncertain and dynamic. Various federal authorities have varied policies on digital assets \n' +
        'depending on how they define cryptocurrency. \n' +
        ' \n' +
        'The Securities and Exchange Commission (SEC), the Commodity Futures Trading \n' +
        'Commission (CFTC), and the Internal Revenue Service (IRS) each have unique interpretations \n' +
        'of cryptocurrencies: \n' +
        ' \n' +
        'SEC: Cryptocurrencies are securities. The SEC wants to classify digital assets as securities. \n' +
        'The agency is concerned with investor protection, and requires that all offerings that qualify as \n' +
        '“investment contracts” be formally registered. \n' +
        ' \n' +
        'CFTC: Cryptocurrencies are commodities. The CFTC argues that cryptocurrencies are \n' +
        'commodities, akin to oil or gold. The agency defines commodities as assets that can support \n' +
        'futures contracts, and it already regulates an active market for cryptocurrency futures. \n' +
        ' \n' +
        'IRS: Cryptocurrencies are property. The IRS classifies digital assets as property. Categorizing \n' +
        'digital assets in this way means that every sale, trade, or purchase using cryptocurrency is \n' +
        'potentially taxable, and capital gains tax rates apply\n' +
        '1\n' +
        '. \n' +
        ' \n' +
        'There is no uniform definition of “cryptocurrency,” which is often referred to as “virtual \n' +
        'currency,” “digital assets,” “digital tokens,” “crypto assets” or simply “crypto.” The Uniform \n' +
        'Law Commission and the American Law Institute amended the Uniform Commercial Code to \n' +
        'include Article 12, which defines and governs digital assets specifically. The new article \n' +
        'includes virtual currencies in its definition of “controllable electronic records.” Several states \n' +
        'have already adopted the amendment. Other'
    },
    values: [
       -0.046964775770902634, -0.0892125815153122, 0.05542256683111191,
         0.06624498963356018, 0.03931932523846626, 0.06489600241184235,
       -0.005812276154756546, -0.07102444022893906, 0.05333053320646286,
        0.024098243564367294, -0.002927794586867094, -0.006520590744912624,
       -0.022848689928650856, 0.005921256262809038, -0.026921981945633888,
         0.04346296563744545, 0.010987916961312294, 0.027227234095335007,
        -0.08606017380952835, 0.07412507385015488, -0.00555757200345397,
       -0.033582668751478195, 0.016722366213798523, 0.010063670575618744,
         0.04775138944387436, 0.01867533102631569, -0.06529131531715393,
        0.031135577708482742, -0.04756287485361099, 0.024998780339956284,
        -0.02870243787765503, -0.04400477558374405, -0.034693893045186996,
        0.006173144560307264, 0.03471975773572922, 0.05072491616010666,
       -0.007391277235001326, 0.05621638894081116, -0.061873339116573334,
        -0.02230619639158249, -0.05178350955247879, -0.06526832282543182,
       -0.012195552699267864, -0.07784280180931091, -0.007645567413419485,
         0.05188329517841339, -0.023820294067263603, 0.040329210460186005,
       -0.006740621291100979, 0.02406458370387554, -0.003709077835083008,
       -0.011983840726315975, 0.01234779879450798, -0.012790805660188198,
        0.009635385125875473, -0.03371347114443779, 0.07201739400625229,
        -0.04682004451751709, 0.01573878712952137, 0.014674566686153412,
         0.03418866544961929, -0.049992635846138, -0.015100331045687199,
         0.01719095930457115, -0.0759909376502037, 0.015880728140473366,
         0.08476574718952179, -0.011525239795446396, 0.0635092481970787,
          -0.046188835054636, -0.009680735878646374, 0.069945327937603,
        -0.05230920761823654, -0.01849099062383175, -0.011679166927933693,
      -0.0007394925341941416, 0.002213314874097705, 0.021781587973237038,
       0.0011477058287709951, -0.049207113683223724, 0.04919028654694557,
       -0.032138217240571976, -0.026650331914424896, -0.07662934064865112,
       -0.003029612125828862, 0.042321741580963135, -0.06342870742082596,
         0.07478340715169907, -0.025037793442606926, -0.011078359559178352,
          0.0692291110754013, -0.04985558241605759, -0.020282620564103127,
        -0.02546621672809124, -0.032438211143016815, 0.06131821870803833,
        -0.03800223395228386, 0.0370156466960907, -0.026420457288622856,
        -0.02880142815411091,
      ... 412 more items
    ]
  },
  {
    id: 'Using pinecone-1',
    metadata: {
      title: 'Using pinecone',
      chunkIndex: 1,
      text: ' jurisdictions have attempted to formulate a \n' +
        'detailed definition for the asset class, most have wisely opted for broader, more technology-\n' +
        'agnostic definitions. Those taking the latter approach will be better positioned to regulate as \n' +
        'and when the technology evolves. An Executive Order ("EO") describing a strategy to manage \n' +
        'risks arising from the expansion of digital assets and blockchain technology while promoting \n' +
        'responsible innovation was announced by the Biden Administration. Six major priorities are \n' +
        'the focus of the EO: Protection of consumers and investors; financial stability; illicit financing; \n' +
        'leadership of the United States in the global financial system and economic competitiveness; \n' +
        'financial inclusion; and responsible innovation are the first six priorities. \n' +
        ' \n' +
        '1\n' +
        ' Allie Grace Garnett, Cryptocurrency regulation: Rules are in development, Britannica( August 19\n' +
        'th\n' +
        ' , 2024, \n' +
        '7:40 P.M.), https://www.britannica.com/money/cryptocurrency-regulation. \n' +
        ' \n' +
        '\n' +
        ' \n' +
        ' \n' +
        'In order to further these important goals, the EO requested a variety of studies, plans, and \n' +
        'reports, including ones from the Treasury, on the following topics: (1) the future of money and \n' +
        'the possible effects of a digital currency issued by the US central bank (referred to as a \n' +
        '"CBDC"); and (2) policy recommendations regarding matters of financial inclusion and \n' +
        'consumer protection. In addition, a report on regulatory gaps and risks to financial stability is \n' +
        'required from the Financial Stability Oversight Council. The White House responded to the \n' +
        'EO by releasing a fact sheet that aimed to offer a thorough framework for regulating digital \n' +
        'assets, drawing on suggestions from several departments and agencies within the U.S. \n' +
        'government.\n' +
        '2\n' +
        ' \n' +
        ' \n' +
        ' \n' +
        'The U.S. House of Representatives on 22 May 2024 passed a bill that aims to create a new \n' +
        'legal framework for digital currencies, despite an unusual warning from the U.S. securities \n' +
        "regulator it could create new financial risks. he bill's supporters in the U.S. Congress argue that \n" +
        "the bill will provide regulatory clarity and help promote the industry's growth. The House \n" +
        'approval comes as the U.S. Securities and Exchange Commission (SEC) signals that it will \n' +
        'likely approve applications for spot ether exchange-traded funds in '
    },
    values: [
       -0.01215305831283331, -0.08163626492023468, 0.03031076118350029,
       0.035789426416158676, 0.02823006547987461, -0.035984668880701065,
       0.011898952536284924, -0.08494328707456589, 0.07110155373811722,
       0.004725272301584482, -0.018690671771764755, 0.052204929292201996,
       -0.04314343258738518, -0.03459407016634941, -0.061128146946430206,
       0.010426408611238003, 0.039325252175331116, -0.046677760779857635,
       -0.07206565141677856, 0.04885420948266983, -0.01856551505625248,
       -0.04376964271068573, -0.0050696032121777534, -0.04293038323521614,
      -0.001961897127330303, 0.05629633739590645, -0.020746391266584396,
       0.027686184272170067, -0.015273663215339184, 0.01747259870171547,
       -0.00920314621180296, 0.033357519656419754, 0.04208241403102875,
       0.030558902770280838, 0.043513018637895584, 0.03781116008758545,
       -0.03916411101818085, -0.007487912196666002, -0.09697779268026352,
       -0.03996136039495468, 0.022559845820069313, -0.009801479987800121,
        0.02665015682578087, -0.04858110472559929, -0.005138568114489317,
       0.033241961151361465, 0.014911703765392303, -0.0655408650636673,
      0.0022733742371201515, 0.05596799775958061, -0.021666575223207474,
        0.01654084585607052, -0.0602153055369854, -0.0012716365745291114,
      -0.019702410325407982, 0.03964383900165558, 0.0022103171795606613,
      -0.022064775228500366, 0.049645669758319855, 0.03043937310576439,
       0.006782667711377144, 0.04063132777810097, -0.04703016206622124,
        0.03425659239292145, 0.008798735216259956, -0.0084927286952734,
        0.09001457691192627, 0.037794459611177444, 0.0365360863506794,
      -0.009738944470882416, 0.04126042127609253, 0.056797273457050323,
       -0.07175559550523758, 0.04249320179224014, 0.006665910128504038,
       0.010382317006587982, 0.0175577774643898, 0.013200119137763977,
       -0.06688523292541504, 0.02133914642035961, 0.020075896754860878,
      -0.040042754262685776, 0.04179675877094269, -0.0363689549267292,
        -0.0172052513808012, 0.044214878231287, -0.03892013430595398,
        0.05079952999949455, 0.047452621161937714, -0.018716586753726006,
        0.08843524008989334, -0.014392162673175335, 0.050246722996234894,
       0.014610158279538155, -0.05961014702916145, 0.0400693416595459,
       -0.06775979697704315, 0.002941533923149109, -0.03607490286231041,
       0.024502363055944443,
      ... 412 more items
    ]
  },

```

---

<div class="post-metadata">

### Author: ![hello4](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/hello4/32/3671_2.png) [@hello4](https://community.pinecone.io/u/hello4)
#### Post date: [December 20, 2024, 8:04am UTC](https://community.pinecone.io/t/error-upserting-docs-to-pinecone/7206/2 "2024-12-20T08:04:59Z")

</div>

i was able to fix this by replacing pinecone SDK with pinecone upsert API

---

<div class="post-metadata">

### Author: ![anurag.dev](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/anurag.dev/32/3881_2.png) [@anurag.dev](https://community.pinecone.io/u/anurag.dev)
#### Post date: [February 7, 2025, 12:23pm UTC](https://community.pinecone.io/t/error-upserting-docs-to-pinecone/7206/3 "2025-02-07T12:23:26Z")

</div>

@hello4 Could you please provide pinecone api
