diff --git a/packages/allow-deny/allow-deny.js b/packages/allow-deny/allow-deny.js index 5335627336..8905634296 100644 --- a/packages/allow-deny/allow-deny.js +++ b/packages/allow-deny/allow-deny.js @@ -619,9 +619,9 @@ CollectionPrototype._callMutatorMethodAsync = function _callMutatorMethodAsync(n const mutatorMethodName = this._prefix + name; return this._connection.applyAsync(mutatorMethodName, args, { - returnStubValue: true, + returnStubValue: Meteor.isClient && (this.promiseResolver === 'stub' || this.promiseResolver == null), // StubStream is only used for testing where you don't care about the server - returnServerResultPromise: !this._connection._stream._isStub, + returnServerResultPromise: !this._connection._stream._isStub || Meteor.isClient && this.promiseResolver === 'server', ...options, }); } diff --git a/packages/mongo/collection.js b/packages/mongo/collection.js index 315dfdd447..8ddcc563a9 100644 --- a/packages/mongo/collection.js +++ b/packages/mongo/collection.js @@ -89,6 +89,8 @@ Mongo.Collection = function Collection(name, options) { this._transform = LocalCollection.wrapTransform(options.transform); + this.promiseResolver = options.promiseResolver; + if (!name || options.connection === null) // note: nameless collections never have a connection this._connection = null; @@ -1266,4 +1268,3 @@ function popCallbackFromArgs(args) { return args.pop(); } } -