@ivicos/mongo-graph
v1.0.5
Published
Simple graph-like query tool for mongo db
Downloads
1
Readme
Mongo Graph
Simple util to build graph-ish mongo db data structures.
Every Node has a list of parents.
const mongoGraph = new MongoGraph({ connectionString, collectionName });
/* Get Nodes nested by hierarchy ([
parent{ children: [
child{
children:[
childsChild{
}
]
}
]
}
])
*/
mongoGraph.get({
type: "<type of node> (optional)"
id: "<id of node> (optional)"
parents: "<array of parents> (optional)"
})
// Create Node
mongoGraph.create("<type>",attributes,parents)
// Remove Node
mongoGraph.remove("<id>")
// Update Node
mongoGraph.update("<id>",attributes,parents /* Optional */)