Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
37f2b3b1df | |||
355b9c7aa6 | |||
a40bd67eba | |||
1df3f51e53 | |||
28829ecdb2 | |||
e73e8e3c83 | |||
ace1769ff4 | |||
689d41eab2 | |||
0c4bcfb121 | |||
a75dca0771 | |||
47d006ce47 | |||
fd0e4fc294 | |||
7d86f3382c | |||
1dbbc1ecdb | |||
931b4ce4fd |
140
.gitlab-ci.yml
140
.gitlab-ci.yml
@@ -1,140 +0,0 @@
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- npm install -g @shipzone/npmci
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --production --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
27
changelog.md
Normal file
27
changelog.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-08-18 - 1.0.9 - fix(dependencies)
|
||||
Update dependencies, normalize package scopes to @push.rocks, bump mongodb to v6, adjust tests and add pnpm metadata
|
||||
|
||||
- Bump mongodb dependency from ^4.6.0 to ^6.18.0 (major upgrade — potential breaking changes)
|
||||
- Normalize package scopes from @pushrocks/* to @push.rocks/* across code and dependencies
|
||||
- Replace @gitzone dev tooling with @git.zone equivalents and add @git.zone/tsrun
|
||||
- Change test script to use tstest with --verbose and update test imports to @git.zone/tstest; adjust sample data import paths
|
||||
- Add packageManager field for pnpm@10.14.0 and add pnpm-workspace.yaml (onlyBuiltDependencies)
|
||||
- Remove .gitlab-ci.yml (CI configuration removed)
|
||||
- Update ts/00_commitinfo_data and mongodump.plugins to use @push.rocks naming
|
||||
- Minor test harness change: export default tap.start() instead of tap.start()
|
||||
|
||||
## 2024-05-29 - 1.0.8 - release
|
||||
Finalized 1.0.8 with packaging, configuration, and organization updates.
|
||||
|
||||
- Update package description.
|
||||
- Update TypeScript configuration (tsconfig).
|
||||
- Update npmextra.json githost entries to correct package hosting information.
|
||||
- Switch to new organization scheme for the project.
|
||||
|
||||
## 2022-06-06 - 1.0.1 → 1.0.7 - maintenance
|
||||
Series of maintenance releases and core fixes across multiple minor version bumps.
|
||||
|
||||
- Multiple "fix(core): update" changes applied across versions 1.0.1 through 1.0.7.
|
||||
- Several version-only commits and routine package bumps. No notable user-facing API changes.
|
@@ -2,17 +2,32 @@
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "mongodump",
|
||||
"description": "a tool to handle dumps of mongodb databases",
|
||||
"npmPackagename": "@pushrocks/mongodump",
|
||||
"description": "A tool to create and manage dumps of MongoDB databases, supporting data export and import.",
|
||||
"npmPackagename": "@push.rocks/mongodump",
|
||||
"license": "MIT",
|
||||
"projectDomain": "push.rocks"
|
||||
"projectDomain": "push.rocks",
|
||||
"keywords": [
|
||||
"mongodb",
|
||||
"database backup",
|
||||
"data dump",
|
||||
"database restore",
|
||||
"mongodb export",
|
||||
"mongodb import",
|
||||
"database management",
|
||||
"mongodb management",
|
||||
"data backup",
|
||||
"data recovery"
|
||||
]
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
}
|
||||
}
|
1020
package-lock.json
generated
1020
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
56
package.json
56
package.json
@@ -1,24 +1,24 @@
|
||||
{
|
||||
"name": "@pushrocks/mongodump",
|
||||
"version": "1.0.5",
|
||||
"name": "@push.rocks/mongodump",
|
||||
"version": "1.0.9",
|
||||
"private": false,
|
||||
"description": "a tool to handle dumps of mongodb databases",
|
||||
"description": "A tool to create and manage dumps of MongoDB databases, supporting data export and import.",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)"
|
||||
"test": "(tstest test/ --verbose)",
|
||||
"build": "(tsbuild --web --allowimplicitany)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsbundle": "^2.0.5",
|
||||
"@gitzone/tstest": "^1.0.44",
|
||||
"@pushrocks/smartdata": "^5.0.5",
|
||||
"@pushrocks/smartmongo": "^2.0.3",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@git.zone/tsbuild": "^2.1.25",
|
||||
"@git.zone/tsbundle": "^2.0.5",
|
||||
"@git.zone/tsrun": "^1.3.3",
|
||||
"@git.zone/tstest": "^2.3.4",
|
||||
"@push.rocks/smartdata": "^5.0.5",
|
||||
"@push.rocks/smartmongo": "^2.0.3",
|
||||
"@types/node": "^17.0.40"
|
||||
},
|
||||
"browserslist": [
|
||||
@@ -37,12 +37,30 @@
|
||||
"readme.md"
|
||||
],
|
||||
"dependencies": {
|
||||
"@pushrocks/lik": "^6.0.0",
|
||||
"@pushrocks/smartfile": "^9.0.6",
|
||||
"@pushrocks/smartjson": "^4.0.6",
|
||||
"@pushrocks/smartpath": "^5.0.5",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@tsclass/tsclass": "^4.0.3",
|
||||
"mongodb": "^4.6.0"
|
||||
}
|
||||
"@push.rocks/lik": "^6.0.0",
|
||||
"@push.rocks/smartfile": "^11.2.7",
|
||||
"@push.rocks/smartjson": "^5.0.6",
|
||||
"@push.rocks/smartpath": "^6.0.0",
|
||||
"@push.rocks/smartpromise": "^4.0.2",
|
||||
"@tsclass/tsclass": "^9.2.0",
|
||||
"mongodb": "^6.18.0"
|
||||
},
|
||||
"keywords": [
|
||||
"mongodb",
|
||||
"database backup",
|
||||
"data dump",
|
||||
"database restore",
|
||||
"mongodb export",
|
||||
"mongodb import",
|
||||
"database management",
|
||||
"mongodb management",
|
||||
"data backup",
|
||||
"data recovery"
|
||||
],
|
||||
"homepage": "https://code.foss.global/push.rocks/mongodump",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://code.foss.global/push.rocks/mongodump.git"
|
||||
},
|
||||
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
|
||||
}
|
||||
|
8755
pnpm-lock.yaml
generated
Normal file
8755
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
2
pnpm-workspace.yaml
Normal file
2
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
onlyBuiltDependencies:
|
||||
- esbuild
|
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@@ -0,0 +1 @@
|
||||
|
112
readme.md
112
readme.md
@@ -1,39 +1,91 @@
|
||||
# @pushrocks/mongodump
|
||||
a tool to handle dumps of mongodb databases
|
||||
# @push.rocks/mongodump
|
||||
a tool to handle dumps of MongoDB databases
|
||||
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/mongodump)
|
||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/mongodump)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/mongodump)
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/mongodump/)
|
||||
|
||||
## Status for master
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||
npm | [](https://lossless.cloud)
|
||||
Snyk | [](https://lossless.cloud)
|
||||
TypeScript Support | [](https://lossless.cloud)
|
||||
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||
## Install
|
||||
To use @push.rocks/mongodump in your project, run:
|
||||
```bash
|
||||
npm install @push.rocks/mongodump --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class intellisense
|
||||
This guide provides an overview of how to work with @push.rocks/mongodump to handle dumps of MongoDB databases efficiently.
|
||||
|
||||
## Contribution
|
||||
### Setting up a MongoDB Dump Target
|
||||
First, you'll need to describe your MongoDB database using an interface provided by the module. Here's a sample descriptor:
|
||||
|
||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||
```typescript
|
||||
import { IMongoDescriptor } from '@tsclass/tsclass';
|
||||
import { MongoDump, MongoDumpTarget } from '@push.rocks/mongodump';
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
const myMongoDescriptor: IMongoDescriptor = {
|
||||
mongoDbName: '<database_name>',
|
||||
mongoDbUser: '<database_user>',
|
||||
mongoDbPass: '<database_password>',
|
||||
mongoDbUrl: 'mongodb+srv://<user>:<password>@<cluster_url>/<dbname>?retryWrites=true&w=majority',
|
||||
};
|
||||
```
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
### Creating and Using the MongoDump Instance
|
||||
To interact with MongoDB for dumping purposes, you'll use the `MongoDump` class:
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
```typescript
|
||||
async function setupMongoDump() {
|
||||
const mongoDump = new MongoDump();
|
||||
const mongoDumpTarget = await mongoDump.addMongoTargetByMongoDescriptor(myMongoDescriptor);
|
||||
|
||||
// mongoDumpTarget can now be used for further operations
|
||||
}
|
||||
setupMongoDump();
|
||||
```
|
||||
|
||||
### Dumping Collections to a Directory
|
||||
To dump the collections of a database into a directory with files representing each document, you can use the `dumpCollectionToDir` method. This method is useful for creating backups or migrating data:
|
||||
|
||||
```typescript
|
||||
async function dumpCollections() {
|
||||
const mongoDump = new MongoDump();
|
||||
const mongoDumpTarget = await mongoDump.addMongoTargetByMongoDescriptor(myMongoDescriptor);
|
||||
|
||||
await mongoDumpTarget.dumpAllCollectionsToDir('./path/to/dumpDir', null, true);
|
||||
// This dumps all collections to the specified directory, cleaning the directory before dumping.
|
||||
}
|
||||
dumpCollections();
|
||||
```
|
||||
|
||||
### Advanced Dumping Options
|
||||
For more control over the dumping process, including naming conventions for dumped files or handling specific collections, you can explore methods like `dumpCollectionToDir` for individual collections and advanced configurations concerning directory cleanliness and document naming.
|
||||
|
||||
### Shutting Down Properly
|
||||
It's important to close down database connections properly once your dumping operations are complete:
|
||||
|
||||
```typescript
|
||||
async function shutDownMongoDump() {
|
||||
const mongoDump = new MongoDump();
|
||||
await mongoDump.stop();
|
||||
// Closes all open database connections gracefully
|
||||
}
|
||||
shutDownMongoDump();
|
||||
```
|
||||
|
||||
### Conclusion
|
||||
The @push.rocks/mongodump module provides a flexible approach to handling MongoDB database dumps, whether it's for backup, migration, or other purposes. By leveraging TypeScript and modern async patterns, it integrates smoothly into modern Node.js applications focused on MongoDB interactions.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import * as smartdata from '@pushrocks/smartdata';
|
||||
import * as smartdata from '@push.rocks/smartdata';
|
||||
|
||||
let db: smartdata.SmartdataDb;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartmongo from '@pushrocks/smartmongo';
|
||||
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||
import * as smartmongo from '@push.rocks/smartmongo';
|
||||
import * as mongodump from '../ts/index.js';
|
||||
|
||||
import * as sampledata from './sampledata.js';
|
||||
@@ -36,4 +36,4 @@ tap.test('should stop the smartmongo instance', async () => {
|
||||
await testSmartMongo.stop();
|
||||
});
|
||||
|
||||
tap.start();
|
||||
export default tap.start();
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/mongodump',
|
||||
version: '1.0.5',
|
||||
description: 'a tool to handle dumps of mongodb databases'
|
||||
name: '@push.rocks/mongodump',
|
||||
version: '1.0.9',
|
||||
description: 'A tool to create and manage dumps of MongoDB databases, supporting data export and import.'
|
||||
}
|
||||
|
@@ -6,11 +6,11 @@ export {
|
||||
}
|
||||
|
||||
// pushrocks scope
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartjson from '@pushrocks/smartjson';
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as lik from '@push.rocks/lik';
|
||||
import * as smartfile from '@push.rocks/smartfile';
|
||||
import * as smartjson from '@push.rocks/smartjson';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
|
||||
export {
|
||||
lik,
|
||||
|
@@ -3,7 +3,12 @@
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext"
|
||||
}
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user