{"id":17609895,"url":"https://github.com/vixalien/feathers-mongo","last_synced_at":"2026-04-20T19:02:41.585Z","repository":{"id":62422800,"uuid":"519534078","full_name":"vixalien/feathers-mongo","owner":"vixalien","description":"A Feathers database adapter for MongoDB using official Deno driver for MongoDB (deno-mongo)","archived":false,"fork":false,"pushed_at":"2022-07-30T14:22:09.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T23:41:51.297Z","etag":null,"topics":["deno","feathers","mongo","service"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/vixalien.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}},"created_at":"2022-07-30T14:11:47.000Z","updated_at":"2022-07-30T14:14:07.000Z","dependencies_parsed_at":"2022-11-01T17:33:41.388Z","dependency_job_id":null,"html_url":"https://github.com/vixalien/feathers-mongo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vixalien/feathers-mongo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixalien%2Ffeathers-mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixalien%2Ffeathers-mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixalien%2Ffeathers-mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixalien%2Ffeathers-mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vixalien","download_url":"https://codeload.github.com/vixalien/feathers-mongo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixalien%2Ffeathers-mongo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31776054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"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":["deno","feathers","mongo","service"],"created_at":"2024-10-22T17:23:54.365Z","updated_at":"2026-04-20T19:02:41.559Z","avatar_url":"https://github.com/vixalien.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# feathers-mongo\n\nAn adapter for [FeathersJS](http://feathersjs.com) that uses [mongo](https://deno.land/x/mongo) as its backend for Deno.\n\n## Feathers\n\nThis is a [FeathersJS database adapter](https://docs.feathersjs.com/api/databases/adapters.html) so it supports the existing Common API and Querying syntax. Visit the feathers docs to view the API.\n\n## Usage\n\n```ts\nimport {\n  MongoClient,\n} from \"https://deno.land/x/mongo/mod.ts\";\n\nimport {\n  MongoService\n} from \"https://deno.land/x/feathers_mongo/mod.ts\";\n\nconst client = new MongoClient();\n\nawait client.connect(\"mongodb://127.0.0.1:27017\");\n\ninterface UserSchema {\n  _id: ObjectId;\n  username: string;\n  password: string;\n  age: number;\n}\n\nconst db = client.database(\"test\");\nconst users = db.collection\u003cUserSchema\u003e(\"users\");\n\nconst Users = new MongoService\u003cUserSchema\u003e({\n  // set the collection\n  Model: users,\n  // default pagination options\n  paginate: {\n    default: 10,\n    max: 50\n  },\n  // allow creating multiple items at once\n  multi: true,\n})\n```\n\n## Create\n\n```ts\nUsers.create({\n  username: \"user\",\n  password: \"notsecure\",\n  age: 20,\n});\n\n// create multiple items (requires the `multi` option to be true)\nUsers.create([\n  {\n    username: \"many\",\n    password: \"notsecure\",\n    age: 21,\n  },\n  {\n    username: \"users\",\n    password: \"notsecure\",\n    age: 22,\n  }\n]);\n```\n\n## Find\n\n```ts\n// find one item\nUsers.get(\"62e5362d75e5bef94ed2edc4\");\n\n// run a query\nUsers.find({\n  query: {\n    username: {\n      $ne: null\n    }\n  }\n});\n\n// find by query\nUsers.find({\n  query: {\n    _id: new ObjectId(\"62e5362d75e5bef94ed2edc4\")\n  }\n});\n\n// override pagination\nUsers.find({}, {\n  paginate: {\n    max: 5,\n    default: 5,\n  }\n})\n\n// Querying\nUsers.find({\n  query: {\n    // equality\n    username: \"johndoe\",\n    // limit\n    $limit: 5,\n    // skip\n    $skip: 2,\n    // sort\n    $sort: {\n      username: 1,\n    },\n    // projections (_id will always be selected)\n    $select: [\n      \"username\",\n      \"password\"\n    ],\n    password: {\n      // arrays (in and not in)\n      $in: [\"a\",\"b\"],\n      $nin: [\"c\", \"d\"],\n    },\n    age: {\n      // less than \u0026 greater than\n      $lt: 30,\n      $gt: 10,\n      // not equal\n      $ne: 10,\n      // or\n      $or: [\n        21,\n        22\n      ]\n    }\n  }\n})\n```\n\n\u003e Notes:\n\u003e\n\u003e - You can use any supported mongo [`Filter`](https://doc.deno.land/https://deno.land/x/mongo/mod.ts/~/Filter) in `query`\n\u003e - Search is not yet supported\n\n## Update\n\n```ts\n// patch only sets the provided attributes\nUsers.patch(\"62e5362d75e5bef94ed2edc4\", {\n  username: \"modified\"\n})\n\n// update replaces the item entirely\nUsers.update(\"62e5362d75e5bef94ed2edc4\", {\n  username: \"full\",\n  password: \"modified\",\n  age: 23,\n})\n```\n\n## Delete\n\n```ts\nUsers.remove(\"62e5362d75e5bef94ed2edc4\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixalien%2Ffeathers-mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvixalien%2Ffeathers-mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixalien%2Ffeathers-mongo/lists"}