
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Datajson is a data handler type bson that offers ODM environment giving all a simple and solid structure for processing.
Its structure is inspired by the Mongoose ODM. Using similar resources to handle and manipulate files type json
var datajson = require('datajson')({
'path' : '/path/app/data',
'modelPath' : '/path/app/model'
});
var model = datajson.model; // all model load
The setting options are Datajson:
You can deploy directly from the file templates that are working. But for better organization suggest that write in a separate folder, with this example.
File: /model/profile.js
module.exports = function(Model){
return new Model({
name: 'profile',
schema: {
name: {
required: true,
type: String
},
description: String,
active: {
default: false,
type: Boolean
},
categorie: {
default: 'dev',
type: String
},
birth: {
required: true,
type: Date
},
age: Number
}
})
}
From the model you can manipulate your bank as an MDG
These are the methods of model
And, Or and Not
The query can be applied in the search methods, or by adding query method.
model.profile.find({"age" : { "$gt" : 18 } })
In this example we get the data from all major profiles 18 years of age. If we want to get over 18 or disabled the profile would be like this:
model.profile.find({
"$or" : { "age" : { "$gt" : 18 }, "active" : false }
})
Let's find users with the name Philippe or Martin, age less than or equal to 20 years and above 15 years. For this we will use the names regex
model.profile.find({
"$or" : [
{"name" : /philippe/gi},
{"name" : /martin/gi}
],
"$and" : [
{"age" : { "$eq": 15 }},
{"age" : { "$lte": 20 }}
]
})
In line 32 of /src/datajson.js you will find this:
var model = require(path.resolve(modelPath, file))(Model).init(merge(true, defaultConfig, config))
})
But it should be like this:
var model = require(path.resolve(modelPath, file))(Model).init(config)
})
It happens that when passing the value to the variable 'config' for some reason for me unknown variable is populated by several values which are the Model properties. The only solution I found was to pass again the merge function, so the config is not changed. Surely this is happening for some stupid of me. So if you know a solution, be sure to contribute
FAQs
Low-Level Data Manager in json file
We found that datajson 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.