@mongosh/service-provider-server
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -59,3 +59,4 @@ import { MongoClient } from 'mongodb'; | ||
createCollection(dbName: string, collName: string, options: any, dbOptions?: any): Promise<any>; | ||
initializeBulkOp(dbName: string, collName: string, ordered: boolean, options?: {}, dbOptions?: any): Promise<any>; | ||
} | ||
export default CliServiceProvider; |
@@ -605,2 +605,17 @@ "use strict"; | ||
}; | ||
CliServiceProvider.prototype.initializeBulkOp = function (dbName, collName, ordered, options, dbOptions) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!ordered) return [3, 2]; | ||
return [4, this.db(dbName, dbOptions).collection(collName).initializeOrderedBulkOp(options)]; | ||
case 1: return [2, _a.sent()]; | ||
case 2: return [4, this.db(dbName, dbOptions).collection(collName).initializeUnorderedBulkOp(options)]; | ||
case 3: return [2, _a.sent()]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return CliServiceProvider; | ||
@@ -607,0 +622,0 @@ }(service_provider_core_1.ServiceProviderCore)); |
{ | ||
"name": "@mongosh/service-provider-server", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "MongoDB Shell Server Service Provider Package", | ||
@@ -41,4 +41,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@mongosh/errors": "^0.1.0", | ||
"@mongosh/service-provider-core": "^0.1.0", | ||
"@mongosh/errors": "^0.2.0", | ||
"@mongosh/service-provider-core": "^0.2.0", | ||
"@types/sinon": "^7.5.1", | ||
@@ -48,3 +48,3 @@ "@types/sinon-chai": "^3.2.3", | ||
}, | ||
"gitHead": "57433c03fa9dbbd1a2448c396ec963174643fa1d" | ||
"gitHead": "cff9ebb650b2433d345f3ef5d5708b5697b068f9" | ||
} |
import CliServiceProvider from './cli-service-provider'; | ||
import { expect } from 'chai'; | ||
import { MongoClient } from 'mongodb'; | ||
import { startTestServer } from '../../../testing/integration-testing-hooks'; | ||
import { startTestServer, skipIfServerVersion } from '../../../testing/integration-testing-hooks'; | ||
@@ -79,4 +79,5 @@ describe('CliServiceProvider [integration]', function() { | ||
describe('#aggregate', () => { | ||
// NOTE: this will only run on 4.4+, so if we change mongodb-runner to a different version we should be aware this will fail. | ||
context('when passing a $function to be serialized by the driver', () => { | ||
context('when passing a $function to be serialized by the driver', function() { | ||
skipIfServerVersion('< 4.4'); | ||
let result; | ||
@@ -106,2 +107,3 @@ | ||
}); | ||
context('when running against a collection', () => { | ||
@@ -108,0 +110,0 @@ let result; |
@@ -1055,4 +1055,17 @@ import mongodb, { | ||
} | ||
async initializeBulkOp( | ||
dbName: string, | ||
collName: string, | ||
ordered: boolean, | ||
options = {}, | ||
dbOptions?: any | ||
): Promise<any> { | ||
if (ordered) { | ||
return await this.db(dbName, dbOptions).collection(collName).initializeOrderedBulkOp(options); | ||
} | ||
return await this.db(dbName, dbOptions).collection(collName).initializeUnorderedBulkOp(options); | ||
} | ||
} | ||
export default CliServiceProvider; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242354
4673
+ Added@mongosh/errors@0.2.2(transitive)
+ Added@mongosh/i18n@0.2.2(transitive)
+ Added@mongosh/service-provider-core@0.2.2(transitive)
- Removed@mongosh/errors@0.1.0(transitive)
- Removed@mongosh/i18n@0.1.0(transitive)
- Removed@mongosh/service-provider-core@0.1.0(transitive)
Updated@mongosh/errors@^0.2.0