{"id":34183701,"url":"https://github.com/baxiry/docstore","last_synced_at":"2026-03-12T17:07:59.109Z","repository":{"id":64300533,"uuid":"528984934","full_name":"baxiry/docstore","owner":"baxiry","description":"Fast, lightweight, embedded document database","archived":false,"fork":false,"pushed_at":"2025-05-22T12:35:57.000Z","size":735,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-18T13:59:00.479Z","etag":null,"topics":["database","document","embedded","mongodb-like","nosq"],"latest_commit_sha":null,"homepage":"","language":"Go","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/baxiry.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,"zenodo":null}},"created_at":"2022-08-25T19:07:20.000Z","updated_at":"2025-05-22T12:36:00.000Z","dependencies_parsed_at":"2023-02-10T03:46:20.980Z","dependency_job_id":"483da7a7-afc6-45e1-8165-e116208bc935","html_url":"https://github.com/baxiry/docstore","commit_stats":null,"previous_names":["baxiry/kv","bashery/kv","baxiry/litedb","baxiry/docsdb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/baxiry/docstore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fdocstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fdocstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fdocstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fdocstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baxiry","download_url":"https://codeload.github.com/baxiry/docstore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxiry%2Fdocstore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30434157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: 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","embedded","mongodb-like","nosq"],"created_at":"2025-12-15T14:39:23.450Z","updated_at":"2026-03-12T17:07:59.101Z","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;\" \u003eDocstore\u003c/h1\u003e\n\n**Docstore:** A ***lightweight, fast, embedded, document database.*** Think of it as the SQLite of the NoSQL world.\n\n\n**Installation**\n\n```bash\ngo get https://github.com/baxiry/docstore\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***Docstore receives queries as a JSON format**\n\n\n\n### Insert\n***insert one object:***\n\n```json\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 \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: 18 }, // Greater than 18\n  },\n}\n```\n\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] },\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%2Fdocstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaxiry%2Fdocstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaxiry%2Fdocstore/lists"}