{"id":15684972,"url":"https://github.com/erfanium/mongo-aggregate-shorthand","last_synced_at":"2025-03-30T11:11:26.348Z","repository":{"id":114228362,"uuid":"302185443","full_name":"erfanium/mongo-aggregate-shorthand","owner":"erfanium","description":"A short-hand tool for creating mongodb aggregates!","archived":false,"fork":false,"pushed_at":"2020-10-08T14:16:39.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T12:46:11.840Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/erfanium.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}},"created_at":"2020-10-07T23:35:06.000Z","updated_at":"2020-10-08T14:16:41.000Z","dependencies_parsed_at":"2024-04-21T08:00:32.458Z","dependency_job_id":null,"html_url":"https://github.com/erfanium/mongo-aggregate-shorthand","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fmongo-aggregate-shorthand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fmongo-aggregate-shorthand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fmongo-aggregate-shorthand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erfanium%2Fmongo-aggregate-shorthand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erfanium","download_url":"https://codeload.github.com/erfanium/mongo-aggregate-shorthand/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246308051,"owners_count":20756482,"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-10-03T17:22:41.638Z","updated_at":"2025-03-30T11:11:26.331Z","avatar_url":"https://github.com/erfanium.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongo-aggregate-shorthand\nA short-hand system for creating Mongodb aggregates! Great for analytics stuff with Mongodb\n\n## Example\n```sh\nMATCH examID=1 \u0026\u0026 sandbox=false \u0026\u0026 ratio \u003e 10\nSORT percent -1\nLOOKUP users userID:_id as user\nSET user=user[0]\nPROJECT percent user ratio\n```\nequals \n```js\n[\n      {\n         $match: {\n            examID: 1,\n            sandbox: false,\n            ratio: { $gt: 10 }\n         },\n      },\n\n      {\n         $sort: {\n            percent: -1,\n         },\n      },\n      {\n         $lookup: {\n            from: 'users',\n            localField: 'userID',\n            foreignField: '_id',\n            as: 'user',\n         },\n      },\n      {\n         $set: {\n            user: { $arrayElemAt: ['$user', 0] },\n         },\n      },\n      {\n         $project: {\n            percent: 1,\n            user: 1,\n            ratio: 1,\n         },\n      }\n]\n```\n\n## Usage: \nclone repo then:\n- Install dependencies:\n```sh\nnpm i\n```\n- To parse from file:\n```sh\nnpm run file example.txt\n```\n\n- REPL mode:\n```sh\nnpm run repl\n```\n\n## Stage\nImplementation, Give us your opinion!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfanium%2Fmongo-aggregate-shorthand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferfanium%2Fmongo-aggregate-shorthand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfanium%2Fmongo-aggregate-shorthand/lists"}