@ivicos/mongo-graph
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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 */)

Readme

Keywords

none

Package Sidebar

Install

npm i @ivicos/mongo-graph

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

25.5 kB

Total Files

7

Last publish

Collaborators

  • samuelp-mw
  • ivicos-friedrich