Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eabda34aca | |||
| 0e41748da5 | |||
| f4586d529d | |||
| c09eaf613d |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartmongo",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartmongo",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/mongodump": "^1.0.7",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartmongo",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.6",
|
||||
"private": false,
|
||||
"description": "create a local mongodb for testing",
|
||||
"main": "dist_ts/index.js",
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartmongo',
|
||||
version: '2.0.4',
|
||||
version: '2.0.6',
|
||||
description: 'create a local mongodb for testing'
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export class SmartMongo {
|
||||
public async getMongoDescriptor(): Promise<plugins.smartdata.IMongoDescriptor> {
|
||||
await this.readyPromise;
|
||||
return {
|
||||
mongoDbName: `smartmongo_testdatabase`,
|
||||
mongoDbUrl: this.mongoReplicaSet.getUri(),
|
||||
};
|
||||
}
|
||||
@@ -42,11 +43,10 @@ export class SmartMongo {
|
||||
await this.mongoReplicaSet.cleanup();
|
||||
}
|
||||
|
||||
public async stopAndDumpToDir(dirArg: string) {
|
||||
const dumpDir = plugins.smartpath.transform.makeAbsolute(dirArg);
|
||||
public async stopAndDumpToDir(dirArg: string, nameFunctionArg?: (doc: any) => string, emptyDirArg = true) {
|
||||
const mongodumpInstance = new plugins.mongodump.MongoDump();
|
||||
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(await this.getMongoDescriptor());
|
||||
await mongodumpTarget.dumpAllCollectionsToDir(dumpDir);
|
||||
await mongodumpTarget.dumpAllCollectionsToDir(dirArg, nameFunctionArg, emptyDirArg);
|
||||
await mongodumpInstance.stop();
|
||||
await this.stop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user