My data structure is like this:
[{
"IdFrete":7,
"Descricao":"Frete XYZ",
"PrazoEntrega":"(Até 10 dias)",
"DescricaoArea":"TO",
"CepInicio":77000000,
"CepFim":77999999,
"PesoIni":0,
"PesoFim":5000,
"Valor":80
},{
"IdFrete":7,
"Descricao":"Frete XYZ",
"PrazoEntrega":"(Até 10 dias)",
"DescricaoArea":"SP",
"CepInicio":1000000,
"CepFim":19999999,
"PesoIni":0,
"PesoFim":5000,
"Valor":80
}]
I need make a select by interval of CepInicio and CepFim and interval of PesoIni and PesoFim. Something like in SQL: Select * from table where (CepInicio>=14100500 and CepFim <=14100500) and (PesoIni>=500 and PesoFim <=500)
I tried to create array index:
tb.createIndex('searchFreteIdx', ['IdFrete', 'CepInicio', 'PesoIni', 'CepFim', 'PesoFim'], {unique:false,multiEntry: true});
But I believe that's wrong. And can't find any sample to construct this index