Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Mongoose -> Neo4J plugin / middleware
$ npm i -S moneo
-- View on npmjs
var moneo = require("moneo")({url:'http://localhost:7474'});
SomeSchema.plugin(moneo);
!!! Connection string must of course be changed... !!!
To mark schema property to be stored into a neo4j node property add nodeProperty: true
. Default is false.
e.g.
SomeSchema = mongoose.Schema({
firstName: {type: String, nodeProperty: true}, // Will be persisted to neo4j
lastName: {type: String, nodeProperty: true}, // Will be persisted to neo4j
mongoSpecificValue1: {type: String, nodeProperty: false}, // Will not be persisted to neo4j
mongoSpecificValue2: String // Will not be persisted to neo4j
});
Simple ref properties will be used to create relations. Use relName:'Relation Name'
to specify relation name.
e.g.
SomeSchema = mongoose.Schema({
teacher: {type: mongoose.Schema.ObjectId, ref: 'OtherSchema', relName: "Taught By"},
});
A nested schema including a ref property will be used to create relations with properties. e.g.
SomeSchema = mongoose.Schema({
supervisor: {
person: {type: mongoose.Schema.ObjectId, ref: 'OtherSchema', relName: "Supervised By"},
startDate: Date
},
});
Array of ref properties will be used to create multiple relations. e.g.
SomeSchema = mongoose.Schema({
students: [{type: mongoose.Schema.ObjectId, ref: 'OtherSchema', relName: 'Teaches'}]
});
Array of objects that include a ref property will be used to create multiple relations with relation properties. e.g.
SomeSchema = mongoose.Schema({
takenClasses: [{
class: {type: mongoose.Schema.ObjectId, ref: 'OtherSchema',relName:'Takes Class'},
grade: Number,
year: Number
}]
});
To run a cypher query the static model cypherQuery(opts,cb,_tx)
function can be used. It behaves the same as neo4j.GraphDatabase.cypher(options,cb,_tx)
.
e.g.
SomeModel.cypherQuery({query: 'match (n:Person)-[r:Takes_Class]-(c:Class) return n,r,c'}, function (err, res) {
// if ok - res contains results...
});
MIT
FAQs
Mongoose Neo4J plugin / middleware
The npm package moneo receives a total of 0 weekly downloads. As such, moneo popularity was classified as not popular.
We found that moneo 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.