{"id":32772571,"url":"https://github.com/tashikomaaa/neomongo.nvim","last_synced_at":"2026-01-17T18:39:20.003Z","repository":{"id":318829842,"uuid":"1076930418","full_name":"tashikomaaa/neomongo.nvim","owner":"tashikomaaa","description":"Manage your MongoDB databases directly from Neovim — connect, query, and explore data without leaving your editor.","archived":false,"fork":false,"pushed_at":"2025-10-15T16:15:58.000Z","size":7524,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-15T19:37:12.471Z","etag":null,"topics":["neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/tashikomaaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2025-10-15T14:37:39.000Z","updated_at":"2025-10-15T16:16:02.000Z","dependencies_parsed_at":"2025-10-16T13:58:06.309Z","dependency_job_id":null,"html_url":"https://github.com/tashikomaaa/neomongo.nvim","commit_stats":null,"previous_names":["tashikomaaa/neomongo.nvim"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tashikomaaa/neomongo.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashikomaaa%2Fneomongo.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashikomaaa%2Fneomongo.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashikomaaa%2Fneomongo.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashikomaaa%2Fneomongo.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tashikomaaa","download_url":"https://codeload.github.com/tashikomaaa/neomongo.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tashikomaaa%2Fneomongo.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28516198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:28:00.501Z","status":"ssl_error","status_checked_at":"2026-01-17T18:28:00.150Z","response_time":85,"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":["neovim-plugin"],"created_at":"2025-11-04T09:01:56.735Z","updated_at":"2026-01-17T18:39:19.965Z","avatar_url":"https://github.com/tashikomaaa.png","language":"Lua","readme":"# neomongo.nvim/lua/neomongo\n![neomongo logo](https://github.com/tashikomaaa/neomongo.nvim/blob/a26f208c2c51a60479c30da5536f06e85c888545/assets/logo-full.png)\n\n**Manage your MongoDB collections straight from Neovim.**\n\n`neomongo.nvim` offers a lightweight workflow built around a Telescope-powered dashboard where you can explore databases, preview documents, and update collections without leaving your editor.\n\n---\n\n## 🚀 Features\n\n- 🔭 Telescope dashboard listing databases on the left and collections on the right\n- 📚 Collection picker that expands into a document list with live previews\n- 🔍 Inline JSON filter (press `\u003cC-f\u003e` inside the document picker) to query the current collection without leaving Telescope\n- 🤖 Filter autocompletion (`\u003cC-Space\u003e` in the document picker) suggesting field/operator templates based on the sampled documents\n- 🧾 ASCII banner highlighting the active connection, database, and document metadata\n- ✍️ Editable collection buffers (`:w` writes back to MongoDB using `mongosh`)\n- 🗃️ Connection profiles stored in `~/.config/nvim/neomongo_connections.lua`\n- ⚙️ Simple commands for connecting, listing databases, listing collections, and running ad hoc queries\n\n---\n\n## 📦 Installation\n# neomongo.nvim/lua/neomongo\n\n\u003ca href=\"https://dotfyle.com/tashikomaaa/neomongonvim-lua-neomongo\"\u003e\u003cimg src=\"https://dotfyle.com/tashikomaaa/neomongonvim-lua-neomongo/badges/plugins?style=flat\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://dotfyle.com/tashikomaaa/neomongonvim-lua-neomongo\"\u003e\u003cimg src=\"https://dotfyle.com/tashikomaaa/neomongonvim-lua-neomongo/badges/leaderkey?style=flat\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://dotfyle.com/tashikomaaa/neomongonvim-lua-neomongo\"\u003e\u003cimg src=\"https://dotfyle.com/tashikomaaa/neomongonvim-lua-neomongo/badges/plugin-manager?style=flat\" /\u003e\u003c/a\u003e\n\n\n## Install Instructions\n\n \u003e Install requires Neovim 0.9+. Always review the code before installing a configuration.\n\nClone the repository and install the plugins:\n\n```sh\ngit clone git@github.com:tashikomaaa/neomongo.nvim ~/.config/tashikomaaa/neomongo.nvim\n```\n\nOpen Neovim with this config:\n\n```sh\nNVIM_APPNAME=tashikomaaa/neomongo.nvim/lua/neomongo nvim\n```\n`neomongo.nvim` only depends on [`telescope.nvim`](https://github.com/nvim-telescope/telescope.nvim) and `plenary.nvim`.\n\n```lua\n-- lazy.nvim example\n{\n  \"tashikomaaa/neomongo.nvim\",\n  dependencies = {\n    \"nvim-lua/plenary.nvim\",\n    \"nvim-telescope/telescope.nvim\",\n  },\n}\n```\n\nOnce installed, the plugin is ready to use after configuration (see below).\n\n---\n\n## ⚙️ Setup\n\n```lua\nrequire(\"neomongo\").setup({\n  uri = \"mongodb://localhost:27017\",\n  connection_name = \"Local dev\",\n  connections_file = vim.fn.stdpath(\"config\") .. \"/neomongo_connections.lua\",\n  prompt_for_connection = true, -- set to false to skip the picker when only one entry exists\n})\n```\n\n### Connection profiles\n\nOn first launch, `neomongo` ensures that the connections file exists (defaults to `~/.config/nvim/neomongo_connections.lua`). The file returns a Lua table:\n\n```lua\nreturn {\n  { name = \"Local\", uri = \"mongodb://localhost:27017\" },\n  { name = \"Replica set\", uri = \"mongodb://mongo-01:27017\" },\n  -- Add more connections here\n}\n```\n\nWhen `prompt_for_connection` is `true` (default), `:NeomongoDashboard` opens a picker letting you choose which connection you want to use. If only one connection is defined you can skip the prompt by setting `prompt_for_connection = false`.\n\n---\n\n## 🧭 Dashboard Workflow\n\n1. Run `:NeomongoDashboard`.\n2. Pick a connection (if several are defined). The picker lists databases and collections, each prefixed with an icon.\n3. Hover a collection to preview up to 100 documents on the right. Each entry shows a folded one-line JSON summary.\n4. Press `\u003cCR\u003e` on a collection to open a **document picker**: left-hand list of documents, right-hand JSON preview (Tree-sitter folds are enabled when available). Type a JSON filter in the Telescope prompt and hit `\u003cC-f\u003e` to re-query the collection (empty prompt reloads the default 100 docs). Need a hand? Hit `\u003cC-Space\u003e` for autocompletion templates (equals, `$in`, `$regex`, `$exists`, comparisons, `$or`, …) and then tweak the generated JSON. Press `\u003cCR\u003e` again to pop a floating window with the selected document; edit it directly and hit `:w` to update MongoDB and return to the dashboard, or use `\u003cC-e\u003e` to switch to the full editable collection buffer.\n5. In the editable buffer (`neomongo://db/collection`), update the JSON array and hit `:w`; the plugin validates the JSON and issues insert-or-update commands for each document (documents *must* keep their `_id` field).\n\n\u003e ℹ️ Removing a document from the buffer does **not** delete it remotely. The save routine performs insert or update operations only. Document folding relies on the `nvim-treesitter` JSON parser when available.\n\u003e The editor prettifies JSON automatically; if a document contains extremely long lines Neovim may disable syntax highlighting to keep things responsive.\n\n#### Quick filters from the picker\n\nWhile the document picker is open, you can narrow the result set without leaving Telescope:\n\n1. Type any valid MongoDB JSON filter (e.g. `{\"status\":\"recruteur\"}` or `{\"missionId\":{\"$in\":[\"123\",\"456\"]}}`) into the prompt, or press `\u003cC-Space\u003e` to pick a ready-made template for the currently sampled fields.\n2. Press `\u003cC-f\u003e` (insert or normal mode) to execute the query. Up to 200 matching documents are shown; an empty prompt reloads the default unfiltered list.\n3. Continue navigating, editing, or saving as usual.\n\nThis uses the same normalization routines as the save path, so `_id` values and unique indexes are handled consistently.\n\u003e Autocompletion assumes the current prompt contains valid JSON; if you get an error, tidy up the syntax before retrying `\u003cC-Space\u003e`.\n\nTemplates currently offered:\n\n- `equals value` — quickly add `{ \"field\": \"value\" }`\n- `$in list` — scaffold `{ \"field\": { \"$in\": [\"a\", \"b\"] } }`\n- `$regex pattern` — add `{ \"field\": { \"$regex\": \"\" } }`\n- `$exists flag` — add `{ \"field\": { \"$exists\": true } }`\n- `$gte` / `$lte` — add range boundaries\n- `$or`, `$and`, `$nor` — create compound array filters at the root\n\n### Quick-start alias\n\nAdd this to your shell config if you want to jump into the dashboard from the command line:\n\n```sh\nalias neomongovim='nvim +\"lua require(\\\"neomongo\\\").setup({ prompt_for_connection = true })\" +\"NeomongoDashboard\"'\n```\n\n---\n\n## 📜 Commands\n\n| Command | Description |\n|---------|-------------|\n| `:NeomongoConnect` | Display a notification confirming a connection to the configured URI |\n| `:NeomongoListDBs` | List databases using `mongosh` and echo the JSON response |\n| `:NeomongoListCollections {db}` | List collections for the provided database name |\n| `:NeomongoQuery {expression}` | Run an arbitrary `mongosh` expression against the configured URI |\n| `:NeomongoDashboard` | Launch the Telescope dashboard described above |\n\nAll commands rely on `M.config.uri`; the dashboard additionally honours the connection selected from your profiles file.\n\n---\n\n## 🔧 Requirements\n\n- **Neovim 0.9+**\n- **mongosh** available on your `PATH`\n- **nvim-lua/plenary.nvim**\n- **nvim-telescope/telescope.nvim**\n\n---\n\n## 🤝 Contributing\n\nIssues, ideas, and pull requests are welcome! Please open an issue to discuss large changes before submitting a PR.\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Open a pull request 🚀\n\n## 🧹 Development Workflow\n\n- `make lint` runs [Luacheck](https://github.com/mpeterv/luacheck) against the `lua/` directory to catch undefined globals and other common mistakes.\n- `make format` tidies the Lua sources with [StyLua](https://github.com/JohnnyMorganz/StyLua); use `make format-check` to verify formatting without modifying files.\n- Continuous integration runs two separate GitHub Actions (`Lua Lint` and `Lua Formatting`) on pushes and pull requests to guarantee consistent style across contributions.\n- The linter and formatter configurations live in `.luacheckrc` and `stylua.toml` respectively—feel free to tweak them if new rules are needed.\n\n---\n\n## 📄 License\n\nMIT License © 2025 [tashikomaaa](https://github.com/tashikomaaa)\n","funding_links":[],"categories":["Database"],"sub_categories":["Automation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftashikomaaa%2Fneomongo.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftashikomaaa%2Fneomongo.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftashikomaaa%2Fneomongo.nvim/lists"}