Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

92
Views
How to post element in existing document couchdb

Hi I want to create a couchdb database of this format where I can add items in the right type of item(Vegetables or Fruits) enter image description here

But I want to know how can I add some products in the catalog with the nano utils of couchdb without erasing the list of items already created. The actual method to add products in my catalog is this one: but the problem is that I can add only one item to the catalog. I wanted to make a product.get() but how can I add items to the get result and how can I insert the new list to the database?

function AddProduct(name, price, image, category, id) {

  return new Promise((resolve, reject) => {
    var catalog = 'catalog'
  
    catalog.insert(
      // 1st argument of nano.insert()
      {
        "catalog": {
          category: {
            id: {
              'name': name,
              'price': price,
              'image': image,
              'category': category
            }
          }
        }
      }, 'catalog',
      (error, success) => {
        if (success) {
          resolve(name)
        } else {
          reject(
            new Error(`In adding (${name}). Reason: ${error.reason}.`)
          )
        }
      }
    )
  })
}```
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!