1.0.5 • Published 3 years ago

@ivicos/mongo-graph v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago