Socket
Socket
Sign inDemoInstall

@mongosh/service-provider-server

Package Overview
Dependencies
Maintainers
8
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongosh/service-provider-server - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

1

lib/cli-service-provider.d.ts

@@ -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));

8

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc