{"id":51352607,"url":"https://github.com/lima1909/mind","last_synced_at":"2026-07-02T17:13:00.017Z","repository":{"id":333548065,"uuid":"1136476479","full_name":"lima1909/mind","owner":"lima1909","description":"Mind (Multi Index List) finding list items faster by using indexes.","archived":false,"fork":false,"pushed_at":"2026-06-05T17:43:16.000Z","size":825,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T19:22:00.064Z","etag":null,"topics":["collection","filter","filtering","filterlists","fuzzy","indexed-db","indexing","inmemory","inmemory-db","like","phonetic","queries","query","search"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lima1909.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-17T18:59:00.000Z","updated_at":"2026-06-05T17:43:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lima1909/mind","commit_stats":null,"previous_names":["lima1909/fali","lima1909/mind"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lima1909/mind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lima1909%2Fmind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lima1909%2Fmind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lima1909%2Fmind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lima1909%2Fmind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lima1909","download_url":"https://codeload.github.com/lima1909/mind/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lima1909%2Fmind/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35055782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["collection","filter","filtering","filterlists","fuzzy","indexed-db","indexing","inmemory","inmemory-db","like","phonetic","queries","query","search"],"created_at":"2026-07-02T17:12:59.387Z","updated_at":"2026-07-02T17:13:00.008Z","avatar_url":"https://github.com/lima1909.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Mind \n\n**Fast, in-memory indexed collections for Go — filter your data like a database.**\n\n[![GoDoc](https://pkg.go.dev/badge/github.com/lima1909/mind)](https://pkg.go.dev/github.com/lima1909/mind)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/lima1909/mind/ci.yml)](https://github.com/lima1909/mind/actions)\n![License](https://img.shields.io/github/license/lima1909/mind)\n[![Stars](https://img.shields.io/github/stars/lima1909/mind)](https://github.com/lima1909/mind/stargazers)\n\n\u003c/div\u003e\n\n**Mind** (Multi INDex list) lets you query in-memory collections by multiple fields using indexes, just like a database — but without one.\nIt is particularly well suited where data is **read more often than written**.\n\n\u003e ⚠️ Mind is in an early stage of development and the API may change.\n\n## Installation\n\n```bash\ngo get github.com/lima1909/mind\n```\n\n## Features\n\n### Index Types\n\n| Index               | Backed by                                                         | Datatype      | Supported operations                              |\n|---------------------|-------------------------------------------------------------------|---------------|---------------------------------------------------|\n| `MapIndex`          | HashMap                                                           | `comparable`  | `=`, `!=`, `In`                                   |\n| `SortedIndex`       | [SkipList](https://en.wikipedia.org/wiki/Skip_list)               | `ordered`     | `=`, `!=` , `\u003e`, `\u003e=`, `\u003c`, `\u003c=`, `Between`, `In` |\n| `RangeIndex`        | uint8 slice                                                       | `uint8`       | `=`, `!=` , `\u003e`, `\u003e=`, `\u003c`, `\u003c=`, `Between`, `In` |\n| `RangeEncodedIndex` | Range Encoded slice                                               | `uint8`       | `\u003e`, `\u003e=`, `\u003c`, `\u003c=`, `Between`                   |\n| `FenwickIndex`      | [Fenwick](https://en.wikipedia.org/wiki/Fenwick_tree)             | `uint`, `int` | `\u003e`, `\u003e=`, `\u003c`, `\u003c=`, `Between`                   |\n| `TrigramIndex`      | TrigramIndex                                                      | `string`      | `Like`                                            |\n| `PhoneticIndex`     | [American Soundex](https://en.wikipedia.org/wiki/Soundex)         | `string`      | `Sounds`                                          |\n| `FuzzyIndex`        | Fuzzy search (BK-tree for Levenshtein-distance)                   | `string`      | `Fuzzy`, `Fuzzy([string], [distance])`            |\n| `StringIndex`       | SkipList Or HashMap (can combined with Trigram, Phonetic, Fuzzy)  | `string`      | `SortedIndex` or `MapIndex` and combined Index    |\n\n**All operations** can be combined with `AND`, `OR` and `NOT`.\n\n`Like` means:\n  - '%' or '%%' =\u003e all\n  - 'ab%'     =\u003e startsWith (prefix): 'ab'\n  - '%ab'     =\u003e endsWith (suffix): 'ab'\n  - '%ab%'    =\u003e contains: 'ab'\n  - 'abc'     =\u003e equals\n  - '%ab%cd%' =\u003e contains: 'ab' and 'cd', in this order\n\n## Trade-offs\n\n#### Advantages\n- Zero dependencies\n- Generic — works with any struct type\n- Fast reads via bitmap-accelerated index intersection\n- SQL-like query language (with optimizer)\n\n#### Disadvantages\n- Higher memory usage: indexes store additional data alongside user data\n- Slower writes: every mutation updates all registered indexes\n\n\n## Examples\n\n[List](https://github.com/lima1909/mind/blob/main/example/list/main.go)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/lima1909/mind\"\n)\n\ntype Car struct {\n\tname string\n\tage  uint8\n\ttags []string\n}\n\nfunc (c *Car) Name() string   { return c.name }\nfunc (c *Car) Age() uint8     { return c.age }\nfunc (c *Car) Tags() []string { return c.tags }\n\nfunc main() {\n\n\tl := mind.NewList[Car]()\n\n\terr := l.CreateIndex(\"name\", mind.NewMapIndex((*Car).Name))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = l.CreateIndex(\"age\", mind.NewSortedIndex((*Car).Age))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = l.CreateIndex(\"tag\", mind.NewSortedIndexSlice((*Car).Tags))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tl.Insert(Car{name: \"Dacia\", age: 2, tags: []string{\"blue\", \"new\"}})\n\tl.Insert(Car{name: \"Opel\", age: 12, tags: []string{\"old\", \"red\"}})\n\tl.Insert(Car{name: \"Mercedes\", age: 5})\n\tl.Insert(Car{name: \"Dacia\", age: 22, tags: []string{\"blue\", \"old\"}})\n\n\tt := \u0026mind.Tracer{}\n\tvalues, err := l.QueryStr(\n\t\t`(name = \"Opel\" or name = \"Dacia\") and age \u003e= 2 and tag = \"old\"`,\n\t\tmind.WithTracer(t),\n\t).Values()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(values)\n\t// Output:\n\t// [{Opel 12 [old red]} {Dacia 22 [blue old]}\n\n\tfmt.Println()\n\tfmt.Println(\"Trace:\")\n\tfmt.Println(t.PrettyString())\n\t// Output:\n\t// Trace:\n\t// └── name = Opel OR name = Dacia AND age \u003e= 2 AND tag = old  [5.695µs] (2 matches)\n\t//     ├── name = Opel OR name = Dacia AND age \u003e= 2  [4.754µs] (3 matches)\n\t//     │   ├── name = Opel OR name = Dacia  [2.483µs] (3 matches)\n\t//     │   │   ├── name = Opel  [1.289µs] (1 matches)\n\t//     │   │   └── name = Dacia  [131ns] (2 matches)\n\t//     │   └── age \u003e= 2  [1.924µs] (4 matches)\n\t//     └── tag = old  [733ns] (2 matches)\n}\n```\n\n[List with ID](https://github.com/lima1909/mind/blob/main/example/idlist/main.go)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/lima1909/mind\"\n)\n\ntype Car struct {\n\tid   uint\n\tname string\n\tage  uint8\n}\n\nfunc (c *Car) ID() uint     { return c.id }\nfunc (c *Car) Name() string { return c.name }\nfunc (c *Car) Age() uint8   { return c.age }\n\nfunc main() {\n\n\tl := mind.NewListWithID((*Car).ID)\n\n\t// ignore error\n\t_ = l.CreateIndex(\"name\", mind.NewMapIndex((*Car).Name))\n\t_ = l.CreateIndex(\"age\", mind.NewSortedIndex((*Car).Age))\n\n\tl.Insert(Car{id: 1, name: \"Dacia\", age: 2})\n\tl.Insert(Car{id: 2, name: \"Opel\", age: 12})\n\tl.Insert(Car{id: 3, name: \"Mercedes\", age: 5})\n\tl.Insert(Car{id: 4, name: \"Dacia\", age: 22})\n\n\t// ignore error\n\tmercedes, _ := l.Get(3)\n\tfmt.Println(mercedes)\n\t// Output:\n\t// {3 Mercedes 5\n\n\tremoved, _ := l.Remove(4)\n\tfmt.Println(removed)\n\t// Output:\n\t// true\n\n\tt := \u0026mind.Tracer{}\n\tresult, _ := l.Query(mind.Or(mind.Eq(\"name\", \"Opel\"), mind.Lt(\"age\", 10)), mind.WithTracer(t))\n\tfmt.Println(result.Values())\n\t// Output:\n\t// [{1 Dacia 2} {2 Opel 12} {3 Mercedes 5}]\n\n\tfmt.Println()\n\tfmt.Println(\"Trace:\")\n\tfmt.Println(t.PrettyString())\n\t// Output:\n\t// Trace:\n\t// └── name = Opel OR age \u003c 10  [1.85µs] (3 matches)\n\t//     ├── name = Opel  [620ns] (1 matches)\n\t//     └── age \u003c 10  [790ns] (2 matches)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flima1909%2Fmind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flima1909%2Fmind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flima1909%2Fmind/lists"}