// config
{
document: {
id: "id",
store: true,
index: [
{ field: "title", tokenize: "forward" },
],
tag: [ { field: "scoredValue", custom: (data) => Number(data.score) > 1 ? ">1" : false } ]
}
}
// sample docs
[
{
"id": 1,
"title": "One",
"score": null,
},
{
"id": 2,
"title": "Two",
"score": null,
},
]
When exporting the database it will produce an index json like this:
{
...
"1.tag": "[[\"scoredValue\", null],[...],[...]]
}
When I attempt to import I get this error on the 1.tag key:
TypeError: Cannot read properties of null (reading 'length')
Import code:
const docIndex = new Document(name, myConfig);
// where key is `1.tag` from index export
for (const key in blobData.indexes) {
docIndex.import(key, blobData.indexes[key]);
}
When exporting the database it will produce an index json like this:
When I attempt to import I get this error on the
1.tagkey:TypeError: Cannot read properties of null (reading 'length')Import code: