Skip to content
This repository was archived by the owner on Mar 24, 2024. It is now read-only.

Commit 3f053fa

Browse files
committed
Marge Schema to Beta Version because of big Error
1 parent 8a5a716 commit 3f053fa

File tree

3 files changed

+1
-114
lines changed

3 files changed

+1
-114
lines changed

index.js

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const csv = require("csv-parser");
1313
const crypto = require("crypto-js");
1414
const Fuse = require("fuse.js");
1515
const colors = require("./lib/colors");
16-
const model = require("./lib/Model");
1716

1817
function formatDateTime(date) {
1918
const year = date.getFullYear();
@@ -48,9 +47,6 @@ class jsonverse {
4847
this.searchIndex = {};
4948
this.cache = {};
5049

51-
// Initialize models object
52-
this.models = {};
53-
5450
this.init();
5551
}
5652

@@ -117,47 +113,7 @@ class jsonverse {
117113
}
118114
}
119115

120-
// Add a method to create a model using a model
121-
model(modelName, schemaDefinition) {
122-
// Create a model instance and store it in the models object
123-
this.models[modelName] = new Model(modelName, schemaDefinition);
124-
125-
// Return an object with methods like .find(), .save(), .delete(), and .update()
126-
const modelInstance = this.models[modelName];
127-
128-
const modelAPI = {
129-
find: async (query) => {
130-
const result = await this.find(modelName, query);
131-
return result;
132-
},
133-
save: async (data) => {
134-
try {
135-
await modelInstance.save(data);
136-
return Promise.resolve(`${modelName} saved successfully`);
137-
} catch (error) {
138-
return Promise.reject(error);
139-
}
140-
},
141-
delete: async (query) => {
142-
try {
143-
await modelInstance.delete(query);
144-
return Promise.resolve(`${modelName} deleted successfully`);
145-
} catch (error) {
146-
return Promise.reject(error);
147-
}
148-
},
149-
update: async (query, updates) => {
150-
try {
151-
await modelInstance.update(query, updates);
152-
return Promise.resolve(`${modelName} updated successfully`);
153-
} catch (error) {
154-
return Promise.reject(error);
155-
}
156-
},
157-
};
158116

159-
return modelAPI;
160-
}
161117

162118
// Encrypt sensitive data
163119
encrypt(data, secretKey) {

lib/Model.js

Lines changed: 0 additions & 69 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonverse",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "jsonVerse is a lightweight JSON-based database package for Node.js. It provides a simple interface to store, retrieve, and manage data using JSON files.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)