datafolder 1.0.16 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,10 @@ datafolder is a lightning fluid JSON database for high speed SSDs, featuring an
4
4
 
5
5
  ### Changelog
6
6
 
7
+ 1.0.18 Add Embedding Storage Support. Related APIs: dataFolder.insertEmbedding() and dataFolder.delEmbedding(). TODO: Add HNSW support and vector query.
8
+
9
+ 1.0.17 Add Northwind sample data test (test/testQyNorthwind.js)
10
+
7
11
  1.0.16 Add GraphQL sample data test (test/testQyGraphQL.js) to show how to write complex queries.
8
12
 
9
13
  1.0.15 Use [Workers](https://nodejs.org/docs/latest/api/worker_threads.html) to implement snapshot compactor, expire service, outdated data cleaner etc.
@@ -44,6 +48,7 @@ dataFolder.insert("traindata/2026/1/20/chat_0001", {
44
48
  });
45
49
  dataFolder.insert("traindata/2026/1/20/chat_0001/prompt", "What is async/await?");
46
50
  dataFolder.insert("traindata/2026/1/20/chat_0001/answer", "async/await is ...");
51
+ dataFolder.insertEmbedding("traindata/2026/1/20/chat_0001/prompt", new Float32Array([0.36646, 332.8091, 2363.982]));
47
52
  const { email, password, address, feedbackScore } = dataFolder.view("traindata/2026/1/20/chat_0001");
48
53
  address.zipcode = 678;
49
54
  dataFolder.insert("traindata/2026/1/20/chat_0001", { feedbackScore: feedbackScore + 1, address });
@@ -78,6 +83,7 @@ dataFolder.insert(file, { feedbackScore: feedbackScore + 1, address: { city: "c"
78
83
  dataFolder.createFile("path/to/file");
79
84
  dataFolder.createDir("path/to/dir");
80
85
  dataFolder.insert("path/to/file", { email, address: { city, zipcode } });
86
+ dataFolder.insertEmbedding("path/to/file", new Float32Array([235.235, 2949.8823]));
81
87
  ```
82
88
 
83
89
  #### Read
@@ -87,6 +93,7 @@ const dir = dataFolder.dir("path/to/dir");
87
93
  const { subdirList, fileList, sortedSubdirList } = dir;
88
94
  const file = dataFolder.file("path/to/file");
89
95
  const { email, address } = dataFolder.view("path/to/file", { email: 1, addres: 1 });
96
+ const embedding = dataFolder.embedding("path/to/file");
90
97
  ```
91
98
 
92
99
  #### Update
@@ -102,6 +109,7 @@ dataFolder.insert(file, { feedbackScore: feedbackScore + 1 });
102
109
  dataFolder.delDir("path/to/dir");
103
110
  dataFolder.delFile("path/to/file");
104
111
  dataFolder.delContent("path/to/file");
112
+ dataFolder.delEmbedding("path/to/file");
105
113
  dataFolder.remove("path/to/file", { email: 1, address: { zipcode: 1 } });
106
114
  dataFolder.remove(file, { email: 1, address: { zipcode: 1 } });
107
115
  ```
@@ -118,6 +126,7 @@ dataFolder.batch
118
126
  .insert("path/to/chat_details", { user: "user_0001", feedbackScore: 100 })
119
127
  .insert("path/to/prompt", "what is LLM?")
120
128
  .insert("path/to/answer", "LLM is AI...")
129
+ .insertEmbedding("path/to/prompt", [235.0235, 9923.2356])
121
130
  .remove("path/to/file", { address: { city: 1 } })
122
131
  .run();
123
132
  ```