{"id":28823554,"url":"https://github.com/gcsboss/mongo-redux","last_synced_at":"2025-07-03T02:35:03.880Z","repository":{"id":51935230,"uuid":"185124505","full_name":"GCSBOSS/mongo-redux","owner":"GCSBOSS","description":"A thin wrapper around main mongo functionality with simple return values and async/await support.","archived":false,"fork":false,"pushed_at":"2021-05-08T23:14:51.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-19T00:11:18.221Z","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/GCSBOSS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-06T04:38:36.000Z","updated_at":"2020-02-13T16:47:09.000Z","dependencies_parsed_at":"2022-08-23T22:30:58.465Z","dependency_job_id":null,"html_url":"https://github.com/GCSBOSS/mongo-redux","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/GCSBOSS/mongo-redux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GCSBOSS%2Fmongo-redux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GCSBOSS%2Fmongo-redux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GCSBOSS%2Fmongo-redux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GCSBOSS%2Fmongo-redux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GCSBOSS","download_url":"https://codeload.github.com/GCSBOSS/mongo-redux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GCSBOSS%2Fmongo-redux/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263247959,"owners_count":23436946,"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":"2025-06-19T00:10:09.592Z","updated_at":"2025-07-03T02:35:03.870Z","avatar_url":"https://github.com/GCSBOSS.png","language":"JavaScript","readme":"\n# Mongo Redux\n\nMongo Redux is a thin wrapper around MongoDB basic functionality. Aims to provide\nsimple functions on the async/await pattern for short and readable commands.\n\n## Get Started\n1. Add to your project with: `npm i mongo-redux`.\n2. In your code:\n\n```js\n// Import the module\nconst Mongo = require('mongo-redux');\n\n// Instance a new client\nlet mongo = new Mongo();\n\n// Start a connection\nawait mongo.connect('mongodb://127.0.0.1:27017');\n\n// Use functionallity\n\n// insert ( collection, data ) =\u003e Boolean\nawait mongo.insert('Test', { data: 'My Test Document' });\n\n// exists ( collection, key, value ) =\u003e Boolean\nawait mongo.exists('Test', '_id', db.id(myId));\n\n// get ( collection, key, value ) =\u003e Object | false\nawait mongo.get('Test', '_id', db.id(myId));\n\n// find ( collection, query, projection ) =\u003e Array | false\nawait mongo.find('Test', { data: 'My Test Document' }, { _id: 0, name: 1 });\n\n// delete ( collection, key, value ) =\u003e Boolean\nawait mongo.delete('Test', '_id', db.id(myId));\n\n// update ( collection, key, value, updateSpec ) =\u003e Boolean\nawait mongo.update('Test', '_id', db.id(myId), { '$set': { name: 'New Name' } });\n\n// replace ( collection, key, value, replacements ) =\u003e Boolean\nawait mongo.replace('Test', '_id', db.id(myId), { name: 'New Name' });\n\n// push ( collection, key, value, arrayAndNewValue ) =\u003e Boolean\nawait mongo.push('Test', '_id', db.id(myId), { products: 'Cool Product 17' });\n\n// pull ( collection, key, value, arrayAndTargetValue ) =\u003e Boolean\nawait mongo.pull('Test', '_id', db.id(myId), { products: 'Awful Product 16' });\n\n// Create indexes\nawait mongo.index('Test', { email: 1 }, { unique: true });\n\n// Access mongodb Database object\nlet info = await mongo.db.collectionsInfo();\n\n// Close the connection\nawait mongo.close();\n```\n\n## Reporting Bugs\nIf you have found any problems with this module, please:\n\n1. [Open an issue](https://gitlab.com/GCSBOSS/mongo-redux/issues/new).\n2. Describe what happened and how.\n3. Also in the issue text, reference the label `~bug`.\n\nWe will make sure to take a look when time allows us.\n\n## Proposing Features\nIf you wish to have that awesome feature or have any advice for us, please:\n1. [Open an issue](https://gitlab.com/GCSBOSS/mongo-redux/issues/new).\n2. Describe your ideas.\n3. Also in the issue text, reference the label `~proposal`.\n\n## Contributing\nIf you have spotted any enhancements to be made and is willing to get your hands dirty about it, fork us and [submit your merge request](https://gitlab.com/GCSBOSS/mongo-redux/merge_requests/new) so we can collaborate effectively.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcsboss%2Fmongo-redux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcsboss%2Fmongo-redux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcsboss%2Fmongo-redux/lists"}