{"id":18968907,"url":"https://github.com/isc-rsingh/json2isciris","last_synced_at":"2026-04-05T13:30:17.739Z","repository":{"id":42659535,"uuid":"215108231","full_name":"isc-rsingh/json2isciris","owner":"isc-rsingh","description":"This suite of Node.js utilities automates the process of creating a JSON document database in InterSystems IRIS","archived":false,"fork":false,"pushed_at":"2024-08-20T16:08:32.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T07:09:25.477Z","etag":null,"topics":["intersystems","intersystems-documentdb","intersystems-iris"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isc-rsingh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-14T17:43:42.000Z","updated_at":"2024-08-20T16:08:33.000Z","dependencies_parsed_at":"2024-08-20T18:22:12.306Z","dependency_job_id":null,"html_url":"https://github.com/isc-rsingh/json2isciris","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isc-rsingh%2Fjson2isciris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isc-rsingh%2Fjson2isciris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isc-rsingh%2Fjson2isciris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isc-rsingh%2Fjson2isciris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isc-rsingh","download_url":"https://codeload.github.com/isc-rsingh/json2isciris/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239965923,"owners_count":19726220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["intersystems","intersystems-documentdb","intersystems-iris"],"created_at":"2024-11-08T14:48:48.182Z","updated_at":"2026-04-05T13:30:17.675Z","avatar_url":"https://github.com/isc-rsingh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON IN\n\nThis suite of Node.js utilities automates the process of creating a JSON document database in InterSystems IRIS. It:\n\n1. Takes data in a JSON file and inspects it to discover the data types (`types.js`)\n2. Creates a new document database and schema in InterSystems IRIS (`dbconfig.js`)\n3. Imports the data into the new database (`import.js`)\n\n## Setup\n\n### Node module installation\n\n```sh\nprompt\u003e npm install\n```\n\n### Configuration file\n\nThese programs require a configuration file named `default.json` located in the `config` folder with a property called \"dataFileName\" whose value is the JSON data file name (relative to the location of `types.js`).\n\nHere is a complete example `config/default.json`:\n\n```JavaScript\n{\n    \"dbConfig\": {\n        \"host\": \"http://localhost\",\n        \"port\": \"52773\",\n        \"namespace\": \"USER\",\n        \"dbname\": \"mydatabasename\"\n    },\n    \"dataFileName\": \"sample.json\",\n    \"arrayName\": \"people\",\n    \"schemaFileName\": \"schema.json\",\n    \"maxItems\": 10,\n    \"minThreshold\": 0.2\n}\n```\n\n- **host:** host name where InterSystems IRIS resides\n- **port:** port of which InterSystems IRIS communicates\n- **namespace:** InterSystems IRIS namespace\n- **dbname:** InterSystems IRIS database name\n- **dataFileName:** JSON file name\n- **arrayName:** The JSON property that contains an array of data objects that will be imported\n- **maxItems:** number of data objects to sample when figuring out the schema (if you know your data is clean and every object has the same schema, set this to 1)\n- **minThreshold:** Proportion of properties that must have this data type in order to be kept. For example, if you want properties that have 91% strings and 9% integers to be considered strings, set this to 0.1 (10%)\n\n## `types.js`\n\nThis program inspects the data in a JSON file and figures out what data types it contains. It outputs a configuration file whose name is defined by the schemaFileName property of `config/default.json`. This schema is used by `config.js` to set up the database. \n\nNOTES: \n\n- This utility process _all_ properties. If you have no need to search on all properties, remove the unneeded ones from the schema file before running `dbconfig.js`\n- Currently, it only works with simple JSON files that do not contain arrays or nested properties.\n\n### Requirements\n\n1. A JSON data file\n2. All configuration file properties except \"dbConfig\"\n\n### Usage\n\n```sh\nprompt\u003e node types.js\n```\n\n## `dbconfig.js`\n\nReads the schema file, creates the database and specifies those properties that should be indexed for search.\n\n### Requirements\n\n1. The schema file\n2. The configuration file property \"dbConfig\"\n\n### Usage\n\n```sh\nprompt\u003e node dbconfig.js\n```\n\n## `import.js`\n\nImports the data into the database.\n\n### Requirements\n\n1. The schema file\n2. The configuration file properties \"dbConfig\", \"dataFileName\" and \"arrayName\"\n\n### Usage\n\n```sh\nprompt\u003e node import.js\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisc-rsingh%2Fjson2isciris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisc-rsingh%2Fjson2isciris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisc-rsingh%2Fjson2isciris/lists"}