bigeasy / bigeasy/strata

not storing both key and record

Open
#526 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
163
Forks
18
PR merge metrics
No merged PRs in 30d

Description

hey, so i'm having some trouble with inserts into the tree.

I run the following code:
```
var strata = new Strata({ directory: "./bt", leafSize: 1024, branchSize: 1024 });
strata.create((err,test) => {
strata.mutator("rdf/3/A", (err,cursor) => {
console.log(err);
cursor.insert("rdf/3/A", {data:"test2"}, ~cursor.index);
cursor.unlock(() => {
});
});
});
```

that all goes fine, but when i run:

```
strata.open((err,test) => {
strata.iterator("rdf/3/A", (err,cursor) => {
console.log(cursor.page.items);
cursor.unlock(() => {});
});
});
```

i get

```
[ { key: 'rdf/3/A', record: 'rdf/3/A', heft: 60 } ]
```

it seems like both the key and the record get set to the same thing and the data in the record is lost?

any idea whats going wrong there?

thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the shown Strata create, mutator, insert, open, and iterator sequence, then inspect the resulting cursor.page.items. Trace how the inserted key and record are stored and restored; the issue is done when reopening the tree preserves the record data instead of replacing it with the key.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.