saintedlama/mongoose-version — pull request #11 by benjamta (2014-05-16 12:56:48+00:00)
Title: refVersion is out of sync by 1 for each version. This happens becuase th...

refVersion is out of sync by 1 for each version. This happens because the origin documents version number is not incremented until after the mongose pre save hook is run.

Incrementing the versionCopy's refVersion (if not zero) mimics the behaviour and caused the version number to correctly sync up.