Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

93
Visualizações
Javascript indexed database how to do a more specific search

I have a javascript indexeddb, each primary index is an two-long incrementing array, from [0,0] to [x,y]:

[0,0]
[0,1]
[0,2]
...
[1,0]
[1,1]
...
[x,y]

My current get request involves the following statement:

var transaction = db.transaction("myData", "readonly");
var c = transaction.objectStore("myData");
var a = c.getAll(IDBKeyRange.bound([0,0],[5,5]));

However, this gets all data where the first value is between 0 and 5, and does not take into account the second value, sending a return like the following:

[0,0]
[0,1]
[0,2]
...
[0,y]
[1,0]
...
[5,y]

Is there any way to get it to become more precise and take into account the y range? Using a cursor on all of the values is not acceptable.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

A key-value store is less (much less?) efficient than a simply array for your data.

If you need to "save" the data between invocations of the web page, then perhaps toss that array into a JSON structure. That could be a single item in "indexeddb".

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda