Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
mongodb.json
Advanced tools
$ npm init
$ npm install --save mongodb.json
#setup
const mongooseJson = require("mongodb.json") // mongooseJson it is the class of the package
const usersSchema = { // normal javascript object and its the schema
name: String, // String it is the type of the key
age: Number, // Number it is the type of the key
nickname: String, // String it is the type of the key
password: String || Number
}
const usersModel = new mongooseJson({
path: "database.json" // its the file name
dir: "database" // the dir of database.json file
}, usersSchema /* schema varible*/ )
async function createData() {
const data = usersModel.findOneOrCreate({name: "hello"}) // -> {"name": "hello"}
}
async function findData() {
const data = usersModel.findOne({name: "hello"})
console.log(data) // -> {"name": "hello", id: "......"}
}
async function save() {
const data = usersModel.findOne({name: "hello"})
data.name = "ziad"
data.password = 13313193201e
data.nickname = "ziath"
data.save()
}
async function delete() {
const data = usersModel.findOne({name: "hello"})
data.delete()
}
methods | Description |
---|---|
findOne | find element |
create | create new Object |
fetch | get all data |
findOneOrCreate | find data or create new one |
Ziath#1768
FAQs
fast database with json extends mongoose style
The npm package mongodb.json receives a total of 3 weekly downloads. As such, mongodb.json popularity was classified as not popular.
We found that mongodb.json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.