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

201
Views
IndexedDB - Adding a key to a nested object

I have an IDB with the following structure :

id: 1
name: "test"
operations: [
  {
    column: "active"
    operator: "="
    value: true
  }
]

Here the ID is added like so :

request.onupgradeneeded = e => {
            let db = e.target.result
            db.createObjectStore('filters', { autoIncrement : true, keyPath: 'id'})
        }

Users can either add a new record, in which case it will have id: 2 and so on, or add an operation to an existing record.

What should I do to add an auto incrementing key to each operations ?

Expected result :

id: 1
name: "test"
operations: [
  {
    id: 1
    column: "active"
    operator: "="
    value: true
  },
  {
    id: 2
    column: "age"
    operator: ">"
    value: 32
  },
]
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

IndexedDB won't help you with that, you'll have to handle it in your application code. Auto incrementing keys in IndexedDB are only for the primary key of the object.

about 4 years ago · Juan Pablo Isaza Report
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!