Permalink
Browse files

update docs

  • Loading branch information...
1 parent af12a58 commit 2b2e0e8383d70c2401bd805cf68064e4d2fa76f7 @adrai committed Jan 28, 2017
Showing with 6 additions and 3 deletions.
  1. +3 −3 index.html
  2. +3 −0 source/content.md
View
@@ -73,15 +73,15 @@ <h2 id="subtitle" style="display: none;">eventsourcing for node.js</h2>
<p>example with mongodb:</p>
-<pre><code><span class="kwd">var</span><span class="pln"> es </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">require</span><span class="pun">(</span><span class="str">'eventstore'</span><span class="pun">)({</span><span class="pln"><br />&nbsp; type</span><span class="pun">:</span><span class="pln"> </span><span class="str">'mongodb'</span><span class="pun">,</span><span class="pln"><br />&nbsp; host</span><span class="pun">:</span><span class="pln"> </span><span class="str">'localhost'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; port</span><span class="pun">:</span><span class="pln"> </span><span class="lit">27017</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; dbName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'eventstore'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; eventsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'events'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; snapshotsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'snapshots'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; transactionsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'transactions'</span><span class="pun">,</span><span class="pln"> </span><span class="com">// optional</span><span class="pln"><br />&nbsp; timeout</span><span class="pun">:</span><span class="pln"> </span><span class="lit">10000</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// authSource: 'authedicationDatabase', &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// username: 'technicalDbUser', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// password: 'secret' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// url: 'mongodb://user:pass@host:port/db?opts // optional</span><span class="pln"><br /></span><span class="pun">});</span><span class="pln"><br /></span></code></pre>
+<pre><code><span class="kwd">var</span><span class="pln"> es </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">require</span><span class="pun">(</span><span class="str">'eventstore'</span><span class="pun">)({</span><span class="pln"><br />&nbsp; type</span><span class="pun">:</span><span class="pln"> </span><span class="str">'mongodb'</span><span class="pun">,</span><span class="pln"><br />&nbsp; host</span><span class="pun">:</span><span class="pln"> </span><span class="str">'localhost'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; port</span><span class="pun">:</span><span class="pln"> </span><span class="lit">27017</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; dbName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'eventstore'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; eventsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'events'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; snapshotsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'snapshots'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; transactionsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'transactions'</span><span class="pun">,</span><span class="pln"> </span><span class="com">// optional</span><span class="pln"><br />&nbsp; timeout</span><span class="pun">:</span><span class="pln"> </span><span class="lit">10000</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// maxSnapshotsCount: 3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional, defaultly will keep all snapshots</span><span class="pln"><br />&nbsp; </span><span class="com">// authSource: 'authedicationDatabase', &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// username: 'technicalDbUser', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// password: 'secret' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// url: 'mongodb://user:pass@host:port/db?opts // optional</span><span class="pln"><br /></span><span class="pun">});</span><span class="pln"><br /></span></code></pre>
<p>example with redis:</p>
-<pre><code><span class="kwd">var</span><span class="pln"> es </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">require</span><span class="pun">(</span><span class="str">'eventstore'</span><span class="pun">)({</span><span class="pln"><br />&nbsp; type</span><span class="pun">:</span><span class="pln"> </span><span class="str">'redis'</span><span class="pun">,</span><span class="pln"><br />&nbsp; host</span><span class="pun">:</span><span class="pln"> </span><span class="str">'localhost'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; port</span><span class="pun">:</span><span class="pln"> </span><span class="lit">6379</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; db</span><span class="pun">:</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; prefix</span><span class="pun">:</span><span class="pln"> </span><span class="str">'eventstore'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; eventsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'events'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; snapshotsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'snapshots'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; timeout</span><span class="pun">:</span><span class="pln"> </span><span class="lit">10000</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// password: 'secret' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br /></span><span class="pun">});</span><span class="pln"><br /></span></code></pre>
+<pre><code><span class="kwd">var</span><span class="pln"> es </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">require</span><span class="pun">(</span><span class="str">'eventstore'</span><span class="pun">)({</span><span class="pln"><br />&nbsp; type</span><span class="pun">:</span><span class="pln"> </span><span class="str">'redis'</span><span class="pun">,</span><span class="pln"><br />&nbsp; host</span><span class="pun">:</span><span class="pln"> </span><span class="str">'localhost'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; port</span><span class="pun">:</span><span class="pln"> </span><span class="lit">6379</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; db</span><span class="pun">:</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; prefix</span><span class="pun">:</span><span class="pln"> </span><span class="str">'eventstore'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; eventsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'events'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; snapshotsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'snapshots'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; timeout</span><span class="pun">:</span><span class="pln"> </span><span class="lit">10000</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// maxSnapshotsCount: 3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional, defaultly will keep all snapshots</span><span class="pln"><br />&nbsp; </span><span class="com">// password: 'secret' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional</span><span class="pln"><br /></span><span class="pun">});</span><span class="pln"><br /></span></code></pre>
<p>example with tingodb:</p>
-<pre><code><span class="kwd">var</span><span class="pln"> es </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">require</span><span class="pun">(</span><span class="str">'eventstore'</span><span class="pun">)({</span><span class="pln"><br />&nbsp; type</span><span class="pun">:</span><span class="pln"> </span><span class="str">'tingodb'</span><span class="pun">,</span><span class="pln"><br />&nbsp; dbPath</span><span class="pun">:</span><span class="pln"> </span><span class="str">'/path/to/my/db/file'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; eventsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'events'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; snapshotsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'snapshots'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; transactionsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'transactions'</span><span class="pun">,</span><span class="pln"> </span><span class="com">// optional</span><span class="pln"><br />&nbsp; timeout</span><span class="pun">:</span><span class="pln"> </span><span class="lit">10000</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br /></span><span class="pun">});</span><span class="pln"><br /></span></code></pre>
+<pre><code><span class="kwd">var</span><span class="pln"> es </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">require</span><span class="pun">(</span><span class="str">'eventstore'</span><span class="pun">)({</span><span class="pln"><br />&nbsp; type</span><span class="pun">:</span><span class="pln"> </span><span class="str">'tingodb'</span><span class="pun">,</span><span class="pln"><br />&nbsp; dbPath</span><span class="pun">:</span><span class="pln"> </span><span class="str">'/path/to/my/db/file'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; eventsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'events'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; snapshotsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'snapshots'</span><span class="pun">,</span><span class="pln"> &nbsp; &nbsp; &nbsp; </span><span class="com">// optional</span><span class="pln"><br />&nbsp; transactionsCollectionName</span><span class="pun">:</span><span class="pln"> </span><span class="str">'transactions'</span><span class="pun">,</span><span class="pln"> </span><span class="com">// optional</span><span class="pln"><br />&nbsp; timeout</span><span class="pun">:</span><span class="pln"> </span><span class="lit">10000</span><span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// optional</span><span class="pln"><br />&nbsp; </span><span class="com">// maxSnapshotsCount: 3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// optional, defaultly will keep all snapshots</span><span class="pln"><br /></span><span class="pun">});</span><span class="pln"><br /></span></code></pre>
<p>example with azuretable:</p>
View
@@ -50,6 +50,7 @@ example with mongodb:
snapshotsCollectionName: 'snapshots', // optional
transactionsCollectionName: 'transactions', // optional
timeout: 10000 // optional
+ // maxSnapshotsCount: 3 // optional, defaultly will keep all snapshots
// authSource: 'authedicationDatabase', // optional
// username: 'technicalDbUser', // optional
// password: 'secret' // optional
@@ -67,6 +68,7 @@ example with redis:
eventsCollectionName: 'events', // optional
snapshotsCollectionName: 'snapshots', // optional
timeout: 10000 // optional
+ // maxSnapshotsCount: 3 // optional, defaultly will keep all snapshots
// password: 'secret' // optional
});
@@ -79,6 +81,7 @@ example with tingodb:
snapshotsCollectionName: 'snapshots', // optional
transactionsCollectionName: 'transactions', // optional
timeout: 10000 // optional
+ // maxSnapshotsCount: 3 // optional, defaultly will keep all snapshots
});
example with azuretable:

0 comments on commit 2b2e0e8

Please sign in to comment.