Hierarchical Converter for Array of Objects

Overview

Conversor Hierárquico para Array de Objetos - Hierarchical Converter to Array of Objects

Docker-compose

Cria a interface network e containers indicados no arquivo docker-compose.yml.

$ docker-compose up -d

Listar as redes existentes incluindo a rede mongo-compose-network foi gerada através do docker-compose.yml

$ docker network ls

Listar os containers - ( List containers )

$ docker-compose ps

MongoDB

Arquivo de Backup com dados para teste - ( Backup file with test data )

Você pode optar por usar os dados do seguinte arquivo se preferir:

Node.js

Instalando as dependencias

$ npm install

Iniciar

$ npm run start

Resultados

Dados de entrada

[
  {
    _id: '6155bbbc84cfce5311f5a939',
    name: 'DAE',
    level: 'Tipo-Documento',
    isDirectory: true,
    parent: '6155bbbc84cfce5311f5a938',
    root: 1
  },
  {
    _id: '6155bbbc84cfce5311f5a93a',
    name: '2021',
    level: 'Ano',
    isDirectory: true,
    parent: '6155bbbc84cfce5311f5a939',
    root: 1
  },
  {
    _id: '6155bbbc84cfce5311f5a93b',
    name: 'Fevereiro',
    level: 'Mes',
    isDirectory: true,
    parent: '6155bbbc84cfce5311f5a93a',
    root: 1
  },
  {
    _id: '6155bbbc84cfce5311f5a93c',
    name: '92248978-DAE A DO NASCIMENTO.pdf',
    level: 'Arquivo',
    isDirectory: false,
    parent: '6155bbbc84cfce5311f5a93b',
    root: 1
  },
  {
    _id: '6155bbbd84cfce5311f5a93d',
    name: 'DAS',
    level: 'Tipo-Documento',
    isDirectory: true,
    parent: '6155bbbc84cfce5311f5a938',
    root: 1
  },
  {
    _id: '6155bbbd84cfce5311f5a93e',
    name: '2021',
    level: 'Ano',
    isDirectory: true,
    parent: '6155bbbd84cfce5311f5a93d',
    root: 1
  },
  {
    _id: '6155bbbd84cfce5311f5a93f',
    name: 'Fevereiro',
    level: 'Mes',
    isDirectory: true,
    parent: '6155bbbd84cfce5311f5a93e',
    root: 1
  }
]

Dados de saída

[
    {
        "_id": "6155bbbc84cfce5311f5a939",
        "name": "DAE",
        "level": "Tipo-Documento",
        "isDirectory": true,
        "parent": "6155bbbc84cfce5311f5a938",
        "root": 1,
        "items": [
            {
                "_id": "6155bbbc84cfce5311f5a93a",
                "name": "2021",
                "level": "Ano",
                "isDirectory": true,
                "parent": "6155bbbc84cfce5311f5a939",
                "root": 1,
                "items": [
                    {
                        "_id": "6155bbbc84cfce5311f5a93b",
                        "name": "Fevereiro",
                        "level": "Mes",
                        "isDirectory": true,
                        "parent": "6155bbbc84cfce5311f5a93a",
                        "root": 1,
                        "items": [
                            {
                                "_id": "6155bbbc84cfce5311f5a93c",
                                "name": "92248978-DAE.pdf",
                                "level": "Arquivo",
                                "isDirectory": false,
                                "parent":"6155bbbc84cfce5311f5a93b",
                                "root": 1
                            }
                        ]
                    }
                ]
            }
        ]
    },
    {
        "_id": "6155bbbd84cfce5311f5a93d",
        "name": "DAS",
        "level": "Tipo-Documento",
        "isDirectory": true,
        "parent": "6155bbbc84cfce5311f5a938",
        "root": 1,
        "items": [
            {
                "_id": "6155bbbd84cfce5311f5a93e",
                "name": "2021",
                "level": "Ano",
                "isDirectory": true,
                "parent": "6155bbbd84cfce5311f5a93d",
                "root": 1,
                "items": [
                    {
                        "_id": "6155bbbd84cfce5311f5a93f",
                        "name": "Fevereiro",
                        "level": "Mes",
                        "isDirectory": true,
                        "parent": "6155bbbd84cfce5311f5a93e",
                        "root": 1
                    }
                ]
            }
        ]
    }
]

Utilidade

Após a conversão dos dados, você poderar implementar gerenciadores e explorardores de arquivos com facilidade, utilizando bibliotecas como:

You might also like...

Fundamentos, estruturas, função, objeto, array e etc...

JavaScript Fundamentos, estruturas, função, array e etc... Atividades praticas detalhadas e comentadas para todo mundo entender cada tag, bons estudos

Feb 27, 2022

Complete JavaScipt Array methods Cheatsheet 🚀

Complete JavaScipt Array methods Cheatsheet 🚀

Javascript Array Cheatsheet 👾 Click to download ☝ Important 🚨 There is no way this is perfect or include all the methods. I'll try to fix/add more m

Dec 7, 2022

Draft specification for a proposed Array.fromAsync method in JavaScript.

Array.fromAsync for JavaScript ECMAScript Stage-1 Proposal. J. S. Choi, 2021. Specification available Polyfill available Why an Array.fromAsync method

Dec 14, 2022

Analisador de números utilizando Array JavaScript com Html 5 e CSS 3

Olá pessal, tudo bem? :D Esse site foi desenvolvido para analisar números armazenados em um array chamado "dados[]". Temos dois botões um input e uma

Jan 6, 2022

A simple module to get porperties of an array

A simple module to get statistical porperties of an array. Currently the possible properties are mean, stdev and variance.

Nov 29, 2022

🧰 Javascript array-like containers for multithreading

بسم الله الرحمن الرحيم Struct Vec 🧰 Javascript array-like containers for multithreading Efficiently communicating between js workers is a pain becaus

Jun 23, 2022

Useful for managing a wrapping index for an array of items.

use-wrapping-index Useful for managing a wrapping index for an array of items. Usage import useWrappingIndex from "@alexcarpenter/use-wrapping-index";

Dec 9, 2022

Converts an iterable, iterable of Promises, or async iterable into a Promise of an Array.

iterate-all A utility function that converts any of these: IterableT IterablePromiseT AsyncIterableT AsyncIterablePromiseT Into this: Prom

Jun 7, 2022

Práctica sobre métodos de array

Práctica de Arrays Este es el repositorio de acompañamiento de este stream. Si querés saber más sobre Arrays podes visitar la MDN en su artículo de pr

Dec 28, 2022
Owner
Victor Vinícius Eustáquio de Almeida
Victor Vinícius Eustáquio de Almeida
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Neo: Hierarchical Confusion Matrix Visualization

Neo: Hierarchical Confusion Matrix The confusion matrix, a ubiquitous visualization for helping people evaluate machine learning models, is a tabular

Apple 252 Dec 15, 2022
The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with the HTML5 Canvas element much easier.

EaselJS EaselJS is a library for building high-performance interactive 2D content in HTML5. It provides a feature-rich display list to allow you to ma

CreateJS 8k Dec 29, 2022
A plugin for creating hierarchical navigation in Astro projects. Supports breadcrumbs too!

astro-navigation A plugin for creating hierarchical navigation in Astro projects. Supports breadcrumbs too! Full docs coming soon! Basic usage This pa

Tony Sullivan 7 Dec 19, 2022
Minimal implementation of SLIP-0010 hierarchical deterministic (HD) wallets

micro-ed25519-hdkey Secure, minimal implementation of SLIP-0010 hierarchical deterministic (HD) wallets. Uses audited @noble/ed25519 under the hood. B

Paul Miller 11 Dec 25, 2022
Kyrgyz / Kazakh numbers-to-words converter

Kyrgyz / Kazakh numbers-to-words converter

Timur 4 Mar 12, 2022
The JavaScript currency converter plugin

currencyConverter - javascript currency converter Compatibility IE9 and up, Edge, iOS Safari 6+, Chrome 8+, Firefox 6+ Usage The currencyConverter Ins

null 3 Nov 26, 2022
Small PNG to WEBP converter, terminal based and handy for a frontend developer :D

Image Utils A small util i used while making antstack.com What does it do and how to use? It basically converts .png files to .webp Read about Webp he

Pruthvi Shetty 6 Aug 24, 2022