{"id":24559252,"url":"https://github.com/parcellab/sift","last_synced_at":"2025-03-16T19:41:41.617Z","repository":{"id":243199855,"uuid":"806991077","full_name":"parcelLab/sift","owner":"parcelLab","description":"mongodb queries in JS","archived":false,"fork":false,"pushed_at":"2024-09-24T01:43:01.000Z","size":2988,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-01-23T06:16:00.475Z","etag":null,"topics":["team-backend"],"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/parcelLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-28T09:30:07.000Z","updated_at":"2024-11-26T15:18:08.000Z","dependencies_parsed_at":"2024-06-16T08:45:22.485Z","dependency_job_id":null,"html_url":"https://github.com/parcelLab/sift","commit_stats":null,"previous_names":["parcellab/sift"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fsift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fsift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fsift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Fsift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parcelLab","download_url":"https://codeload.github.com/parcelLab/sift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243922336,"owners_count":20369382,"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":["team-backend"],"created_at":"2025-01-23T06:16:02.166Z","updated_at":"2025-03-16T19:41:41.586Z","avatar_url":"https://github.com/parcelLab.png","language":"TypeScript","readme":"\u003c!---\nThis is the name of the project. It describes the whole project in one sentence, and helps people understand what the main goal and aim of the project is.\n\nConsider putting a CI badge too, for instance:\n [![myworkflow](https://github.com/parcellab/repo-template-base/workflows/myworkflow/badge.svg)](https://github.com/parcellab/repo-template-base/actions?workflow=myworkflow)\n--\u003e\n\n[![codecov](https://codecov.parcellab.dev/gh/parcelLab/sift/graph/badge.svg?token=vvbtaY2PL7)](https://codecov.parcellab.dev/gh/parcelLab/sift)\n\n# Sift\n\nRun MongoDB queries in regular javascript.\n\n(fork of https://github.com/crcn/sift.js)\n\n## Table of Contents (Optional)\n\n\u003c!---\nIf your README is very long, you might want to add a table of contents to make it easy for users to navigate to different sections easily. It will make it easier for readers to move around the project with ease.\n--\u003e\n\n## About The Project\n\n### Why fork https://github.com/crcn/sift.js?\n\nThe original project uses recursion and closures to construct a filter function based on the given MongoDB query.\n\n- this makes debugging difficult, as you have to trace through deep function calls with little context of what the original filter was\n- this makes it slow when V8 has not optimized it, since recursive and closure-heavy function calls make use of many stacks\n- this makes it hard to change a behavior without affecting others\n\nThis fork intends to rewrite sift to a compiler like [ajv](https://github.com/ajv-validator/ajv).\n\n- it intends to provide a verbose mode where each leaf comparison can provide a pass/fail status, and/or what the comparison function looks like\n- it intends to be tiny and fast\n- it intends to be safe, where $where function calls are constrained to the input object\n- it intends to stick to the same behavior as MongoDB query operators as possible\n\n## Installation\n\nSupports node \u003e= 18\n\n`npm i @parcellab/sift`\n\n\u003c!---If you are working on a project that a user needs to install or run locally in a machine,\nyou should include the steps required to install your project and also the required dependencies if any.*\n\nProvide a step-by-step description of how to get the development environment set and running.\nFor instance:\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.\n\n```bash\npip install foobar\n```\n--\u003e\n\n## Usage\n\n\u003c!---\nProvide instructions and examples so users/contributors can use the project. This will make it easy for them in case they encounter a problem – they will always have a place to reference what is expected.*\n\n*You can also make use of visual aids by including materials like screenshots to show examples of the running project and also the structure and design principles used in your project.\n\n```python\nimport foobar\n\n# returns 'words'\nfoobar.pluralize('word')\n\n# returns 'geese'\nfoobar.pluralize('goose')\n\n# returns 'phenomenon'\nfoobar.singularize('phenomena')\n```\n--\u003e\n\n## Contributing\n\n- You need a local copy of MongoDB (e.g. via docker, compose file provided) configured via TEST_MONGODB_URL which defaults to `mongo://localhost:27017/test`\n\n- To update the benchmarks:\n  1. run `npm run test:bench` which will update the human readable `output.txt`\n  2. run `npm run test:bench:csv`\n  3. open `output.xlsx` in Microsoft Excel\n  4. click on Refresh Data Sources (this imports `output.csv` automatically)\n  5. export the updated chart as `output.png`\n\n[Contribution guidelines](CONTRIBUTING.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Fsift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparcellab%2Fsift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Fsift/lists"}