{"id":13701626,"url":"https://github.com/Automattic/monk","last_synced_at":"2025-05-04T21:31:11.018Z","repository":{"id":3064983,"uuid":"4087555","full_name":"Automattic/monk","owner":"Automattic","description":"The wise MongoDB API","archived":false,"fork":false,"pushed_at":"2023-03-13T18:02:49.000Z","size":1254,"stargazers_count":1843,"open_issues_count":48,"forks_count":183,"subscribers_count":131,"default_branch":"master","last_synced_at":"2025-04-28T04:03:55.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Automattic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2012-04-20T14:42:48.000Z","updated_at":"2025-03-04T11:03:22.000Z","dependencies_parsed_at":"2023-07-05T19:47:59.246Z","dependency_job_id":null,"html_url":"https://github.com/Automattic/monk","commit_stats":{"total_commits":363,"total_committers":61,"mean_commits":5.950819672131147,"dds":0.6749311294765841,"last_synced_commit":"5505e62ce616682ea2a6acec0cd9af01afa69069"},"previous_names":["learnboost/monk"],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fmonk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fmonk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fmonk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fmonk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Automattic","download_url":"https://codeload.github.com/Automattic/monk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252403928,"owners_count":21742464,"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-08-02T20:01:52.394Z","updated_at":"2025-05-04T21:31:10.101Z","avatar_url":"https://github.com/Automattic.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eMonk\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://avatars2.githubusercontent.com/u/28830676?v=3\u0026s=200\" /\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eA tiny layer that provides simple yet substantial usability\nimprovements for MongoDB usage within Node.JS.\u003c/strong\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\n[![build status](https://secure.travis-ci.org/Automattic/monk.svg?branch=master)](https://secure.travis-ci.org/Automattic/monk)\n[![codecov](https://codecov.io/gh/Automattic/monk/branch/master/graph/badge.svg)](https://codecov.io/gh/Automattic/monk)\n[![Join the chat at https://gitter.im/Automattic/monk](https://badges.gitter.im/Automattic/monk.svg)](https://gitter.im/Automattic/monk?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n*note*: monk 2.x drop the support for node \u003c 0.12. If you are still using an earlier version, stick to monk 1.x\n\n```js\nconst db = require('monk')('localhost/mydb')\n// or\n// const db = require('monk')('user:pass@localhost:port/mydb')\n\nconst users = db.get('users')\n\nusers.index('name last')\nusers.insert({ name: 'Tobi', bigdata: {} })\nusers.find({ name: 'Loki' }, '-bigdata').then(function () {\n  // exclude bigdata field\n})\nusers.find({}, {sort: {name: 1}}).then(function () {\n  // sorted by name field\n})\nusers.remove({ name: 'Loki' })\n\ndb.close()\n```\n\n## Features\n\n- Well-designed API signatures\n- Easy connections / configuration\n- Command buffering. You can start querying right away\n- Promises built-in for all queries. Easy interoperability with modules\n- Auto-casting of `_id` in queries\n- Allows to set global options or collection-level options for queries. (eg:\n  `castIds` is `true` by default for all queries)\n\n## Middlewares\n\nMost of the Monk's features are implemented as [middleware](https://automattic.github.io/monk/docs/middlewares.html).\n\nThere are a bunch of third-parties middlewares that add even more functionalities to Monk:\n- [monk-middleware-wrap-non-dollar-update](https://github.com/monk-middlewares/monk-middleware-wrap-non-dollar-update)\n- [monk-middleware-debug](https://github.com/monk-middlewares/monk-middleware-debug)\n- [monk-middleware-dereference](https://github.com/monk-middlewares/monk-middleware-dereference)\n\n*Created an nice middleware? Send a PR to add to the list!*\n\n## How to use\n\n[Documentation](https://Automattic.github.io/monk)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAutomattic%2Fmonk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAutomattic%2Fmonk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAutomattic%2Fmonk/lists"}