{"id":23923836,"url":"https://github.com/digen21/dmxdev-mongoose-batch-write","last_synced_at":"2026-04-29T16:01:20.394Z","repository":{"id":269284371,"uuid":"906952021","full_name":"digen21/dmxdev-mongoose-batch-write","owner":"digen21","description":"Writing bulk operation in chunks","archived":false,"fork":false,"pushed_at":"2024-12-22T12:03:48.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T18:51:47.330Z","etag":null,"topics":["batch","mongoose","typescript","utility-function"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@dmxdev/mongoose-batch-write","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/digen21.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":"2024-12-22T12:02:25.000Z","updated_at":"2024-12-22T12:06:09.000Z","dependencies_parsed_at":"2024-12-22T13:29:05.787Z","dependency_job_id":null,"html_url":"https://github.com/digen21/dmxdev-mongoose-batch-write","commit_stats":null,"previous_names":["digen21/dmxdev-mongoose-batch-write"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digen21%2Fdmxdev-mongoose-batch-write","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digen21%2Fdmxdev-mongoose-batch-write/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digen21%2Fdmxdev-mongoose-batch-write/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digen21%2Fdmxdev-mongoose-batch-write/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digen21","download_url":"https://codeload.github.com/digen21/dmxdev-mongoose-batch-write/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240390715,"owners_count":19793782,"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":["batch","mongoose","typescript","utility-function"],"created_at":"2025-01-05T18:50:20.085Z","updated_at":"2026-04-29T16:01:15.348Z","avatar_url":"https://github.com/digen21.png","language":"TypeScript","readme":"# Mongoose Batch Write\n\nThis package provides a utility function to perform bulk write operations in chunks using Mongoose.\n\n## Installation\n\n```bash\nnpm install @dmxdev/mongoose-batch-write\n```\n\n## Usage\n\n```typescript\nimport bulkWriteInChunks from '@dmxdev/mongoose-batch-write';\nimport { Model } from 'mongoose';\n\nconst model: Model\u003cany\u003e = // initialize your Mongoose model\nconst documents = [\n  {\n    updateOne: {\n      filter: { username: doc.username },  // You can filter based on any field\n      update: { $set: doc }, // Update with the entire document\n      upsert: true, // Ensure upsert operation\n    },\n  },\n  // more bulk write operations\n];\nconst chunkSize = 100; // specify the chunk size\nconst options = { ordered: false }; // specify bulk write options\n\nbulkWriteInChunks(model, documents, chunkSize, options)\n  .then(results =\u003e {\n    console.log('Bulk write results:', results);\n  })\n  .catch(error =\u003e {\n    console.error('Bulk write error:', error);\n  });\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigen21%2Fdmxdev-mongoose-batch-write","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigen21%2Fdmxdev-mongoose-batch-write","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigen21%2Fdmxdev-mongoose-batch-write/lists"}