@@ -38,7 +38,7 @@ ExampleSchema.plugin(require('historical'), {
3838Document #historicalDetails()
3939---------------------------------------------------------
4040
41- List historical objects for my document up to a point in history .
41+ List historical documents up to the given date for a document .
4242
4343``` javascript
4444myDocument .historicalDetails (new Date (' 2010-08-17T12:09:36' ), function (e , objs ){
@@ -50,21 +50,23 @@ myDocument.historicalDetails(new Date('2010-08-17T12:09:36'), function(e, objs){
5050Document #historicalRestore()
5151---------------------------------------------------------
5252
53- Restore a document to a previous point in history .
53+ Returns a document as it was at the given date .
5454
5555``` javascript
5656myDocument .historicalRestore (new Date (' 2010-08-17T12:09:36' ), function (e , obj ){
5757 // my document as it was in 2010
5858 // or null, if it either had not yet been created or was deleted before this time
59- if (obj)
59+ if (obj) {
6060 obj .save ();
61+ }
6162});
6263```
6364
6465Document #historicalTrim()
6566------------------------------------------------------
6667
67- Trim up to a point in history.
68+ Creates a new historical document by flattening history up to the given date, and deletes the touched historical documents.
69+ Useful for pruning or establishing a maximum history retention period.
6870
6971``` javascript
7072myDocument .historicalTrim (new Date (' 2010-08-17T12:09:36' ), function (e , obj ){
@@ -77,7 +79,8 @@ myDocument.historicalTrim(new Date('2010-08-17T12:09:36'), function(e, obj){
7779Document #historicalSnapshot()
7880-----------------------------------------------
7981
80- Take a complete and current snapshot of my document and store it in history. Unmodified documents only.
82+ Take a complete and current snapshot of my document and store it in history.
83+ Unmodified documents only.
8184
8285``` javascript
8386myDocument .historicalSnapshot (function (e , obj ){
@@ -89,7 +92,8 @@ myDocument.historicalSnapshot(function(e, obj){
8992Document #historicalClear()
9093--------------------------------------------
9194
92- Clear all history for my document and take a snapshot. Unmodified documents only.
95+ Clear all history for my document and take a snapshot.
96+ Unmodified documents only.
9397
9498``` javascript
9599myDocument .historicalClear (function (e , obj ){
0 commit comments