{"id":18908809,"url":"https://github.com/orbitdb/set-db","last_synced_at":"2025-07-21T10:04:18.803Z","repository":{"id":218146332,"uuid":"745724595","full_name":"orbitdb/set-db","owner":"orbitdb","description":"Set database for orbit-db","archived":false,"fork":false,"pushed_at":"2025-07-07T12:01:27.000Z","size":1295,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-07T13:22:11.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orbitdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-01-20T00:45:01.000Z","updated_at":"2025-07-07T12:01:30.000Z","dependencies_parsed_at":"2025-04-15T05:42:28.582Z","dependency_job_id":null,"html_url":"https://github.com/orbitdb/set-db","commit_stats":null,"previous_names":["reseau-constellation/set","orbitdb/set","orbitdb/set-db"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/orbitdb/set-db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fset-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fset-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fset-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fset-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitdb","download_url":"https://codeload.github.com/orbitdb/set-db/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fset-db/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266278321,"owners_count":23904039,"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":[],"created_at":"2024-11-08T09:28:41.232Z","updated_at":"2025-07-21T10:04:18.783Z","avatar_url":"https://github.com/orbitdb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @orbitdb/set-db\nSet database type for OrbitDB.\n\n[![orbit-db-set tests](https://github.com/orbitdb/set-db/actions/workflows/run-test.yml/badge.svg?branch=main)](https://github.com/orbitdb/set-db/actions/workflows/run-test.yml)\n[![codecov](https://codecov.io/gh/orbitdb/set-db/graph/badge.svg?token=7OZK4BJDej)](https://codecov.io/gh/orbitdb/set-db)\n\n## Installation\n```\n$ pnpm add @orbitdb/set-db\n```\n## Introduction\nAs `Set` database is like a [`Feed`](https://github.com/reseau-constellation/set), but each value can only be present once. Works for primitive types as well as more complex objects.\n\n## Examples\n\nA simple example with `Set`:\n```ts\nimport { createOrbitDB } from \"@orbitdb/core\";\nimport { registerSet } from \"@orbitdb/set-db\";\n\n// Register set database type. IMPORTANT - must call before creating orbit instance !\nregisterSet();\n\nconst orbitdb = await createOrbitDB({ ipfs })\n\nconst db = await orbitdb.open({ type: \"set\" });\n\nawait db.add(1);\nawait db.add(2);\n\nconst all = await db.all();  // [1, 2]\n\nawait db.add(1);\nawait db.all()  // Yay !! Still [1, 2]\n```\n\nAs more complex example with object types:\n```ts\nimport { createOrbitDB } from \"@orbitdb/core\";\nimport { registerSet } from \"@orbitdb/set-db\";\n\n// Register set database type. IMPORTANT - must call before creating orbit instance !\nregisterSet();\n\nconst orbit = await createOrbitDB({ ipfs })\n\nconst db = await orbitdb.open({ type: \"set\" });\n\nawait db.add({a: 1});\nawait db.add({a: 2});\n\nconst all = await db.all();  // [{a: 1}, {a: 2}]\n\nawait db.add({a: 1});\nawait db.all()  // Yay !! Still [{a: 1}, {a: 2}]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb%2Fset-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitdb%2Fset-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb%2Fset-db/lists"}