Releases: Marco5dev/jsonverse
deprecated1
moved to verse.db
github: https://github.com/marco5dev/verse.db
npm: https://www.npmjs.com/package/verse.db
docs: https://versedb.jedi-studio.com
Full Changelog: deprecated...deprecated1
v1.3.4 deprecated is now verse.db
What's Changed
- Add Testing badge to the README.md file by @Marco5dev in #54
- Some fixes to the package by @Marco5dev in #56
Full Changelog: 1.3.3...deprecated
deprecated is now
verse.db package
npm i verse.db
jsonVerse v1.3.3
What's Changed
- Fix: using schema in the package by @Marco5dev in #52
- Update 1.3.3 by @Marco5dev in #53
Full Changelog: v1.3.2...1.3.3
v1.3.2
What's Changed
- Update npm-publish.yml by @Marco5dev in #39
- Update LICENSE by @Marco5dev in #43
- Update README.md by @Marco5dev in #44
- Add using XLSX in the Database
New Contributors
- @Marco5dev made their first contribution in #39
Full Changelog: v1.3.1...v1.3.2
v1.3.1
What Changed ?
- Merge Schema to Beta version
- because of some big error need time to be fixed & we need help, I need help to fix it
Sorry but it will take some time
Full Changelog: v1.3.0...v1.3.1
Beta
New Beta Version Beta-Schema
I tested the Schema and i found a lot of Errors,
And i decided to fix it but it was so big that may take so much time,
So i removed it in the new Version and it will back after fixing it.
you can help me Fixing it in by cloning it with the next commend
git clone -b Beta https://github.com/Marco5dev/jsonverse.git
or
Go to https://github.com/Marco5dev/jsonverse/releases/tag/beta
and install Beta file with the extension like .zip
or .tar.gz
v1.3.0
What Changed ?
- #24 Improving the functions with promises
- #23 Add Database Schema
- Create new documentation Link
https://marco5dev.github.io/jsonverse-documentation/
- Update some functions name to use with the
Schema
like now you can use.Save
,.delete
,.update
, and.find
example bellow
const Jsonverse = require("jsonverse");
const db = new Jsonverse();
const { Schema } = Jsonverse;
const userSchema = new Schema({
name: {
type: String,
required: true,
},
age: {
type: Number,
required: true,
},
email: {
type: String,
required: true,
unique: true,
},
});
module.exports = db.model("User", userSchema);
// Create a new user
const User = require("./path/to/UserSchema.js"); // Import the schema
const newUser = {
id: "123", // there is an auto id generator don't worry this is an example // or you can set a custom id by setting that id: what you want
name: "John Doe",
age: 30,
email: "johndoe@example.com",
}; // example data to save but we use json normally
// Save the new user
User()
.save(newUser)
.then(() => {
console.log("User saved successfully");
})
.catch((error) => {
console.error(error);
});
// Delete a user by query
const deleteQuery = { id: "123" };
User()
.delete(deleteQuery)
.then(() => {
console.log("User deleted successfully");
})
.catch((error) => {
console.error(error);
});
// Update a user by query
const updateQuery = { id: "123" }; // not only the id you use the name or any query like { name: ''John Doe }
const updates = { age: 31 }; // the data you want to update
User()
.update(updateQuery, updates)
.then(() => {
console.log("User updated successfully");
})
.catch((error) => {
console.error(error);
});
// Find users by query
const findQuery = { age: { $gte: 30 } };
// $gte: This operator stands for "greater than or equal to."
// It is used to filter documents where the specified field's value is greater than or equal to the specified value
User()
.find(findQuery)
.then((users) => {
console.log("Users found:", users);
})
.catch((error) => {
console.error(error);
});
Full Changelog: v1.2.7...v1.3.0
v1.2.7
v1.2.6
What changed ?
- Fix a bug in
saveData
The bug:
- the
saveData
function dublicate the old saved data with the new data
Full Changelog: v1.2.5...v1.2.6