Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda