{"id":36739152,"url":"https://github.com/baxiry/zaradb","last_synced_at":"2026-01-12T12:27:17.959Z","repository":{"id":46520455,"uuid":"413512047","full_name":"baxiry/zaradb","owner":"baxiry","description":"ZaraDB is lightweight simple fast documment database ","archived":false,"fork":false,"pushed_at":"2025-07-26T13:34:00.000Z","size":93812,"stargazers_count":14,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T19:33:42.467Z","etag":null,"topics":["database","document","go","golang","nosql","zara","zaradb"],"latest_commit_sha":null,"homepage":"https://github.com/baxiry/zaradb/wiki","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baxiry.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":"2021-10-04T17:01:34.000Z","updated_at":"2025-07-26T13:34:04.000Z","dependencies_parsed_at":"2023-12-25T23:30:41.250Z","dependency_job_id":"d2c96b32-f76c-416a-bce0-0e726a008bf5","html_url":"https://github.com/baxiry/zaradb","commit_stats":null,"previous_names":["bashery/dblite","baxiry/zaradb"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/baxiry/zaradb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fzaradb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fzaradb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fzaradb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fzaradb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baxiry","download_url":"https://codeload.github.com/baxiry/zaradb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fzaradb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["database","document","go","golang","nosql","zara","zaradb"],"created_at":"2026-01-12T12:27:16.913Z","updated_at":"2026-01-12T12:27:17.954Z","avatar_url":"https://github.com/baxiry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 style=\"color:green; font-weight:bold; text-align:center;\" \u003eZaraDB\u003c/h1\u003e\n\nis an open-licensed document database with no hidden restrictions and good performance.\nIts goal is to be a lightweight alternative to common documentary databases.\nIt can also provide superior performance compared to Mongo in many common use cases.\n\n**Installation**\n\n```bash\ngit clone --depth 1 https://github.com/baxiry/zaradb.git \u0026\u0026 cd zaradb \u0026\u0026 go build . \u0026\u0026 ./zaradb\n```\n\nand then open : `localhost:1111`\n\n\n\u003e [!NOTE]\n\u003e It is possible that some things will change within the API, \n\u003e The changes will be partial. Then it stabilizes completely in version 1.0.0.\n\u003e This documentation is intended for library developers, but is useful to anyone interested in documentary databases \n\n\n## API Documentation\n***Zara receives queries in JSON format. However, you can use JavaScript objects through the web interface provided by Zara via: `localhost:1111`***\n\n### Insert\n***insert one object:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"insert\",\n  data: {\n    name: \"adam\",\n    age: 23,\n  },\n}\n```\n\n***Insert many entries at one time:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"insertMany\",\n  data: [\n    { name: \"Jalal\", age: 23 },\n    { name: \"Alex\", age: 30 },\n    { name: \"Adam\", age: 35 },\n  ],\n}\n```\n### Find One \n***find objects:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findOne\",\n}\n```\n### Find One \u0026 match \"where...\"\n***find objects matching specific conditions:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findOne\",\n  match: {\n    name: \"Adam\",\n  },\n}\n```\n\n### Find Many \n***find objects***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n}\n```\n\n### Find Many \u0026 match\n***find objects matching specific conditions:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    name: \"adam\",\n    age: { $gt: 23 }, // Greater than 23\n  },\n}\n```\n\n### match select just objects that matching specific conditions:\n***Operators works with string \u0026 number:***\n\n `$eq` equal, e.g `match:{age:{$eq: 20}}`\n\n `$ne` not equal  `match:{age:{$ne: 20}}`\n\n `$lt` less than, e.g `match:{age:{$lt: 20}}`\n\n `$gt` greater then, e.g `match:{age:{$gt: 20}}`\n\n `$ge` greater than or equal to, e.g `match:{age:{$ge: 20}}`\n\n `$le` less than or equal to, e.g `match:{age:{$le: 20}}`\n\n***Operators works with string only:***\n\n `$st` string starts with, e.g `match:{name:{$st: \"x\"}}`\n\n `$ns` string not starts with, e.g `match:{name:{$ns: \"x\"}}`\n\n `$en` string ends with, e.g `match:{name:{$en: \"x\"}}`\n\n `$nen` string not ends with, e.g `match:{name:{$nen: \"x\"}}`\n\n `$c` string contains, e.g `match:{name:{$c: \"x\"}}`\n\n `$nc` string not contain, e.g `match:{name:{$nc: \"x\"}}`\n\n***Contain.*** String Operators that works with lists:\n\n `$can` string contains any, e.g `match:{name:{$can: ['a','b','c']}}`\n\n `$nca` string not contain any, e.g `match:{name:{$nca: ['a','b','c']}}`\n\n `$cal` string contain all, e.g `match:{name:{$cal: ['a','b','c']}}`\n\n `$nca` string not contain all, e.g `match:{name:{$nca: ['a','b','c']}}`\n\n***Start.*** String Operators that works with lists:\n\n `$san` string starts with any, e.g `match:{name:{$san: ['a','b','c']}}`\n\n `$nsa` string not starts with any, e.g `match:{name:{$nsa: ['a','b','c']}}`\n\n `$ean` string ends with any, e.g `match:{name:{$ean: ['a','b','c']}}`\n\n `$nea` string not ends with any, e.g `match:{name:{$nea: ['a','b','c']}}`\n\n#### find objects matching any value in list:\n\n```javascript\n// Number list:\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    age: { $in: [12, 23, 34] },\n  },\n}\n```\n```javascript\n// String list:\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    name: { $in: [\"John\", \"Zaid\"] },\n  },\n}\n```\n\n#### Select objects that do not match any value in list:\nfind any object whose age does not match any value in the list.\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    age: { $nin: [12, 23, 34] }, // not in\n  },\n}\n```\n#### find any object whose name does not match any value in the list.\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    name: { $nin: [\"akram\", \"zaid\"] },\n  },\n}\n```\n\n#### find objects matching any conditions by `$or` operator:\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    $or: [\n      { name: { $eq: \"akram\" } },\n      { age: { $gt: 13 } },\n    ],\n  },\n}\n```\n\n#### find objects that matching all conditions by `$and` operator:\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    $and: [\n      { name: { $eq: \"akram\" } },\n      { age: { $gt: 13 } },\n    ],\n  },\n}\n```\n\n#### find one object:\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findOne\",\n  match: {\n    name: \"adam\",\n  },\n}\n```\n\n#### find objects matching conditions:\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n  match: {\n    name: \"Adam\",\n  },\n}\n```\n\n### Sort by \u0026 reverse result:\n\n```javascript\n{\n  collection: \"users\",\n  action: \"findMany\",\n  sort:{name:1, age:1},\n}\n// sort by name. names are equal then sort by age\n// param 1 = Ascending, anything else = Descending\n// Preferably use 0 for Descending\n```\n### Update\n\n***Update by ID:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"updateById\",\n  _id: 3,\n  data: {\n    name: \"Alex\",\n    age: 10,\n  },\n}\n```\n\n***Update one or more documents matching criteria:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"updateOne\",\n  match: { _id: { $gt: 33 } }, // greater than 33\n  data: {\n    name: \"hosam\",\n    age: 20,\n  },\n}\n```\n\n### Delete\n\n***Delete the first document matching conditions:***\n\n```javascript\n{\n  collection: \"users\",\n  action: \"deleteOne\",\n  match: {\n    name: \"adam\",\n    age: { $gt: 12 },\n  }\n}\n```\n\n### Aggregation\n\nwe will appely aggregation on this data:\n \n```javascript\n{ \n  collection: \"products\",\n  action: \"insertMany\",\n  data: [\n\t{ item: \"Americanos\", price: 5,  size: \"Short\",  quantity: 22 },\n\t{ item: \"Cappuccino\", price: 6,  size: \"Short\",  quantity: 12 },\n\t{ item: \"Lattes\",     price: 15, size: \"Grande\", quantity: 25 },\n\t{ item: \"Mochas\",     price: 25, size: \"Tall\",   quantity: 11 },\n\t{ item: \"Americanos\", price: 10, size: \"Grande\", quantity: 12 },\n\t{ item: \"Cappuccino\", price: 7,  size: \"Tall\",   quantity: 20 },\n\t{ item: \"Lattes\",     price: 25, size: \"Tall\",   quantity: 30 },\n\t{ item: \"Americanos\", price: 10, size: \"Grande\", quantity: 24 },\n\t{ item: \"Cappuccino\", price: 10, size: \"Grande\", quantity: 25 },\n\t{ item: \"Americanos\", price: 8,  size: \"Tall\",   quantity: 28 }\n  ]\n}\n```\n####  `$min` `$max` `$count` `$avg` `$sum` examples:\n\n```js\n{\n  collection: \"products\",\n  action: \"aggregate\",  \n  group: {\n      _id: 'item',\n      countItems: {$count: ''}, // count param should be zero value\n      minPrice: {$min: 'price'},\n      maxPrice: {$max: 'price'},\n      sumPrice: {$sum: 'price'},\n      averagePrice: { $avg: 'price'},\n      averageAmount: {$avg: { $multiply: ['quantity','price']}}\n    },\n}\n```\n\n#### match \u0026 sort aggregation by gmatch \u0026 gsort (group match, grop sort)\n\n```js\n{\n  collection: \"products\",\n  action: \"aggregate\",  \n  gmatch:{price:{$gte:20}},\n  group: {\n      _id: 'item',\n      countItems: {$count: ''}, // count param should be zero value\n      sumPrice: {$sum: 'price'},\n      averagePrice: { $avg: 'price'},\n      averageAmount: {$avg: { $multiply: ['quantity','price']}}\n    },\n    gsort:{averageAmount:1},\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaxiry%2Fzaradb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaxiry%2Fzaradb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaxiry%2Fzaradb/lists"}