diff --git a/lib/eventstore.js b/lib/eventstore.js index 3539e1cd..20e5d678 100644 --- a/lib/eventstore.js +++ b/lib/eventstore.js @@ -439,6 +439,16 @@ _.extend(Eventstore.prototype, { obj.streamId = obj.aggregateId; + if (obj.revision) { + if (typeof (obj.revision) === 'string') { + const castedRevision = parseFloat(obj.revision); + + if (castedRevision && castedRevision.toString() === obj.revision) { // Determines if the revision was parsed correctly, for the cases where user using custom typed revisions that's not in valid float format like: obj.revision = '1,2,3' + obj.revision = castedRevision; + } + } + } + var self = this; async.waterfall([