Merge branch 'release-3.0-rem-mongo-async-pkg' into release-3.0-mongo-tests

# Conflicts:
#	packages/mongo/collection.js
#	packages/mongo/mongo_driver.js
#	packages/mongo/mongo_livedata_tests.js
#	packages/mongo/observe_changes_tests.js
#	packages/mongo/observe_multiplex.js
#	packages/mongo/oplog_observe_driver.js
This commit is contained in:
Edimar Cardoso
2022-12-21 02:04:03 -03:00
3 changed files with 19 additions and 13 deletions

View File

@@ -23,7 +23,7 @@ import {
MongoInternals = {};
// TODO remove after test
MongoInternals.__packageName = 'mongo'
MongoInternals.__packageName = 'mongo-async';
MongoInternals.NpmModules = {
mongodb: {
@@ -481,6 +481,13 @@ MongoConnection.prototype._update = async function (collection_name, selector, m
if (!mod || typeof mod !== 'object') {
const error = new Error("Invalid modifier. Modifier must be an object.");
if (callback) {
return callback(error);
} else {
throw error;
}
}
throw error;
}

View File

@@ -206,8 +206,8 @@ _.each( ['STRING'], function(idGeneration) {
};
const toAwait = ["insert", "remove", "update"].map(async (op) => {
var arg = (op === "insert" ? {} : 'bla');
var arg2 = {};
const arg = (op === "insert" ? {} : 'bla');
const arg2 = {};
var callOp = async function () {
if (op === "update") {
@@ -1342,7 +1342,7 @@ _.each( ['STRING'], function(idGeneration) {
await Meteor.callAsync('createInsecureCollection', this.collectionName);
Meteor.subscribe('c-' + this.collectionName, expect());
}
}, async function (test, expect) {
}, async function (test) {
const coll = new Mongo.Collection(this.collectionName, collectionOptions);
const id = await runAndThrowIfNeeded(() => coll.insert({}), test);
@@ -1361,7 +1361,7 @@ _.each( ['STRING'], function(idGeneration) {
await Meteor.callAsync('createInsecureCollection', this.collectionName);
Meteor.subscribe('c-' + this.collectionName, expect());
}
}, async function (test, expect) {
}, async function () {
const coll = new Mongo.Collection(this.collectionName, collectionOptions);
// No callback! Before fixing #2413, this method never returned and
@@ -1382,7 +1382,7 @@ _.each( ['STRING'], function(idGeneration) {
await Meteor.callAsync('createInsecureCollection', this.collectionName);
Meteor.subscribe('c-' + this.collectionName, expect());
}
}, async function (test, expect) {
}, async function (test) {
const coll = new Mongo.Collection(this.collectionName, collectionOptions);
const testWidget = {
name: 'Widget name'
@@ -1405,7 +1405,7 @@ _.each( ['STRING'], function(idGeneration) {
await Meteor.callAsync('createInsecureCollection', this.collectionName, collectionOptions);
Meteor.subscribe('c-' + this.collectionName, expect());
}
}, async function (test, expect) {
}, async function (test) {
const self = this;
const coll = self.coll = new Mongo.Collection(self.collectionName, collectionOptions);
@@ -1492,7 +1492,7 @@ _.each( ['STRING'], function(idGeneration) {
})).seconds, 50);
await self.coll.remove(id);
},
async function (test, expect) {
async function (test) {
var self = this;
self.id1 = await runAndThrowIfNeeded(() => self.coll.insert({d: new Date(1356152390004)}), test, false);
test.isTrue(self.id1);
@@ -1521,7 +1521,7 @@ _.each( ['STRING'], function(idGeneration) {
Meteor.subscribe('c-' + this.collectionName, expect());
}
},
async function (test, expect) {
async function (test) {
var self = this;
self.coll = new Mongo.Collection(this.collectionName, collectionOptions);
const id = await runAndThrowIfNeeded(() => self.coll.insert({}), test);
@@ -1548,7 +1548,7 @@ _.each( ['STRING'], function(idGeneration) {
await Meteor.callAsync('createInsecureCollection', this.collectionName, collectionOptions);
Meteor.subscribe('c-' + this.collectionName, expect());
}
}, async function (test, expect) {
}, async function (test) {
const coll = new Mongo.Collection(this.collectionName, collectionOptions);
const id = await runAndThrowIfNeeded(() => coll.insert({b: bin}), test);
test.isTrue(id);
@@ -1569,7 +1569,7 @@ _.each( ['STRING'], function(idGeneration) {
}
},
async function (test, expect) {
async function (test) {
var self = this;
self.coll = new Mongo.Collection(this.collectionName, collectionOptions);
var docId;

View File

@@ -9,7 +9,7 @@
Package.describe({
summary: "Adaptor for using MongoDB and Minimongo over DDP",
version: '1.16.3'
version: '1.16.0'
});
Npm.depends({
@@ -82,7 +82,6 @@ Package.onUse(function (api) {
api.addFiles('remote_collection_driver.js', 'server');
api.addFiles('collection.js', ['client', 'server']);
api.addFiles('connection_options.js', 'server');
api.addAssets('mongo.d.ts', 'server');
});
Package.onTest(function (api) {