json-recursive

0.0.4 • Public • Published

json-recursive

GitHub Stars GitHub Issues Current Version

var collection = [
    {
      "nombre": "Villareal",
      "numero": 1,
      "carreras": [
        {
          "nombre": "Fisico",
          "rating": 4.3,
          "cursos": [
            {
              "nombre": "cuantica",
              "id": 1
            },
            {
              "nombre": "algebra",
              "id": 2
            }
          ]
        },
        {
          "nombre": "Matematica",
          "rating": 4,
          "cursos": [
            {
              "nombre": "algebra",
              "id": 2
            },
            {
              "nombre": "Aritmetica",
              "id": 3
            }
          ]
        }
      ]
    },
    {
      "nombre": "San Marcos",
      "numero": 2,
      "carreras": [
        {
          "nombre": "Medicina",
          "rating": 9.6,
          "cursos": [
            {
              "nombre": "Quimica",
              "id": 4
            },
            {
              "nombre": "Biologia",
              "id": 5
            }
          ]
        },
        {
          "nombre": "Metalurgia",
          "rating": 5,
          "cursos": [
            {
              "nombre": "quimica",
              "id": 4
            },
            {
              "nombre": "Fisica",
              "id": 5
            }
          ]
        }
      ]
    }
  ]

Functions

var jr = require('json-recursive');

findAll

jr.findAll(collection, { 'carreras.cursos.nombre': 'cuantica'})

updateAll

jr.updateAll(collection, {'carreras.cursos.nombre': 'cuantica'}, {'nombre': 'mecanica'})

pushAll

jr.pushAll(collection,{'carreras.cursos.nombre': 'quimica'}, {'nombre': 'javascript', 'id': 6})

removeAll

jr.removeAll(collection, {'carreras.cursos.nombre': 'algebra'})

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.40latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.40
0.0.30
0.0.20

Package Sidebar

Install

npm i json-recursive

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • grovertb