Skip to content

Parse through a json graph object using path sets to extract values.

License

Notifications You must be signed in to change notification settings

jsillitoe/jsongraph-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonGraph Parse

JsonGraph Parse is a library for using path sets to extract values from a JSON Graph object.

Example

var graph = {
    "user_preferencesById": {
        "1": {
            "user": {
                "value": ["usersById", "1"],
                "$type": "ref"
            },
            "key": "favorite_color",
            "user_id": 1,
            "value": "Black",
            "id": 1
        }
    },
    "usersById": {
        "1": {
            "id": 1,
            "firstname": "Jane",
            "lastname": "Smith",
            "preferences": [{
                "value": ["user_preferencesById", "1"],
                "$type": "ref"
            }]
        }
    },
    "user": {
        "value": ["usersById", "1"],
        "$type": "ref"
    }
};


var color = JsonGraph.parse(graph, ['user', 'preferences', 0, 'value']); // Black

About

Parse through a json graph object using path sets to extract values.

Resources

License

Stars

Watchers

Forks

Packages

No packages published