saintedlama / mongoose-version

Mongoose plugin to save document data versions. Documents are saved to a "versioned" document collection before saving original documents and kept for later use.
BSD 2-Clause "Simplified" License
144 stars 35 forks source link

Shadow document is created when adding a new document #15

Closed sandytrinh closed 10 years ago

sandytrinh commented 10 years ago

When using the strategy 'collection' - a copy of the document is added to the shadow collection when the initial master document is created.

The shadow document should only be created when editing an existing document.

The easier solution is to use this.isNew to check if we need to create a shadow copy.

I would create a PR for this fix, but current master branch is not working - see https://github.com/saintedlama/mongoose-version/issues/10

Can you please let me know when master will be fixed?