Skip to content

Commit

Permalink
Documented Mongo_Db::dump
Browse files Browse the repository at this point in the history
  • Loading branch information
WanWizard committed Feb 26, 2016
1 parent dc36e16 commit 502dbeb
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions classes/mongo/methods.html
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,68 @@ <h4 class="method" id="list_collections">list_collections($system_collections =
</tbody>
</table>
</article>

<article>
<h4 class="method" id="dump">dump($collection_name = null, $path = null)</h4>
<p>
The <strong>dump</strong> method allows you to dump one or more collections to a file, in json format.</a>
</p>
<table class="method">
<tbody>
<tr>
<th class="legend">Static</th>
<td>No</td>
</tr>
<tr>
<th>Parameters</th>
<td>
<table class="parameters">
<tr>
<th>Param</th>
<th>Type</th>
<th>Default</th>
<th class="description">Description</th>
</tr>
<tr>
<th><kbd>collection_name</kbd></th>
<td><em>mixed</em></td>
<td><pre class="php"><code>null</code></pre></td>
<td>A single string to specify a collection, an array of strings to specify multiple collections, or <kbd>null</kbd> for all collections.</td>
</tr>
<tr>
<th><kbd>path</kbd></th>
<td><em>string</em></td>
<td><pre class="php"><code>null</code></pre></td>
<td>Path to write the dump to. If not given, the dump will be made to APPPATH."tmp/mongo-YYYYMMDD".</td>
</tr>
</table>
</td>
</tr>
<tr>
<th>Returns</th>
<td>Bool, true.</td>
</tr>
<tr>
<th>Throws</th>
<td>
InvalidPathException, if the file can not be written to the path given<br/>
FileAccessException, if there is no permission to write the file
</td>
</tr>
<tr>
<th>Example</th>
<td>
<pre class="php"><code>// Get a mongo instance
$mongodb = \Mongo_Db::instance();

// dump all collections to APPPATH.'tmp'
$mongodb->dump();
</code></pre>
</tr>
</tbody>
</table>
</article>

</div>

<footer>
Expand Down

0 comments on commit 502dbeb

Please sign in to comment.