Page MenuHomeSealhub

bin_node_modules_mongodb_lib_mongodb_commands_get_more_command.js.html
No OneTemporary

Authored By
Unknown
Size
11 KB
Referenced Files
None
Subscribers
None

bin_node_modules_mongodb_lib_mongodb_commands_get_more_command.js.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bin/node_modules/mongodb/lib/mongodb/commands/get_more_command.js - Prometheus Framework</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title="Prometheus Framework"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 0.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/Represents a
Replicaset Configuration.html">Represents a
Replicaset Configuration</a></li>
<li><a href="../classes/Represents a BatchWriteResult.html">Represents a BatchWriteResult</a></li>
<li><a href="../classes/Represents a Collection.html">Represents a Collection</a></li>
<li><a href="../classes/Represents a Cursor..html">Represents a Cursor.</a></li>
<li><a href="../classes/Represents a CursorStream..html">Represents a CursorStream.</a></li>
<li><a href="../classes/Represents a Db.html">Represents a Db</a></li>
<li><a href="../classes/Represents a GridFS File Stream..html">Represents a GridFS File Stream.</a></li>
<li><a href="../classes/.html"></a></li>
<li><a href="../classes/Represents a MongoClient.html">Represents a MongoClient</a></li>
<li><a href="../classes/Represents a Mongos connection with failover to backup proxies.html">Represents a Mongos connection with failover to backup proxies</a></li>
<li><a href="../classes/Represents a OrderedBulkOperation.html">Represents a OrderedBulkOperation</a></li>
<li><a href="../classes/Represents a Read Preference..html">Represents a Read Preference.</a></li>
<li><a href="../classes/Represents a Server connection..html">Represents a Server connection.</a></li>
<li><a href="../classes/Represents a UnorderedBulkOperation.html">Represents a UnorderedBulkOperation</a></li>
<li><a href="../classes/Represents the Admin methods of MongoDB..html">Represents the Admin methods of MongoDB.</a></li>
<li><a href="../classes/Represents the Grid..html">Represents the Grid.</a></li>
<li><a href="../classes/Represents the GridStore..html">Represents the GridStore.</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/association.html">association</a></li>
<li><a href="../modules/database-accessor.html">database-accessor</a></li>
<li><a href="../modules/field-type-manager.html">field-type-manager</a></li>
<li><a href="../modules/resource-type-manager.html">resource-type-manager</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: bin/node_modules/mongodb/lib/mongodb/commands/get_more_command.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
var BaseCommand = require(&#x27;./base_command&#x27;).BaseCommand,
inherits = require(&#x27;util&#x27;).inherits,
binaryutils = require(&#x27;../utils&#x27;);
/**
Get More Document Command
**/
var GetMoreCommand = exports.GetMoreCommand = function(db, collectionName, numberToReturn, cursorId) {
BaseCommand.call(this);
this.collectionName = collectionName;
this.numberToReturn = numberToReturn;
this.cursorId = cursorId;
this.db = db;
};
inherits(GetMoreCommand, BaseCommand);
GetMoreCommand.OP_GET_MORE = 2005;
GetMoreCommand.prototype.toBinary = function() {
// Validate that we are not passing 0x00 in the colletion name
if(!!~this.collectionName.indexOf(&quot;\x00&quot;)) {
throw new Error(&quot;namespace cannot contain a null character&quot;);
}
// Calculate total length of the document
var totalLengthOfCommand = 4 + Buffer.byteLength(this.collectionName) + 1 + 4 + 8 + (4 * 4);
// Let&#x27;s build the single pass buffer command
var _index = 0;
var _command = new Buffer(totalLengthOfCommand);
// Write the header information to the buffer
_command[_index++] = totalLengthOfCommand &amp; 0xff;
_command[_index++] = (totalLengthOfCommand &gt;&gt; 8) &amp; 0xff;
_command[_index++] = (totalLengthOfCommand &gt;&gt; 16) &amp; 0xff;
_command[_index++] = (totalLengthOfCommand &gt;&gt; 24) &amp; 0xff;
// Write the request ID
_command[_index++] = this.requestId &amp; 0xff;
_command[_index++] = (this.requestId &gt;&gt; 8) &amp; 0xff;
_command[_index++] = (this.requestId &gt;&gt; 16) &amp; 0xff;
_command[_index++] = (this.requestId &gt;&gt; 24) &amp; 0xff;
// Write zero
_command[_index++] = 0;
_command[_index++] = 0;
_command[_index++] = 0;
_command[_index++] = 0;
// Write the op_code for the command
_command[_index++] = GetMoreCommand.OP_GET_MORE &amp; 0xff;
_command[_index++] = (GetMoreCommand.OP_GET_MORE &gt;&gt; 8) &amp; 0xff;
_command[_index++] = (GetMoreCommand.OP_GET_MORE &gt;&gt; 16) &amp; 0xff;
_command[_index++] = (GetMoreCommand.OP_GET_MORE &gt;&gt; 24) &amp; 0xff;
// Write zero
_command[_index++] = 0;
_command[_index++] = 0;
_command[_index++] = 0;
_command[_index++] = 0;
// Write the collection name to the command
_index = _index + _command.write(this.collectionName, _index, &#x27;utf8&#x27;) + 1;
_command[_index - 1] = 0;
// Number of documents to return
_command[_index++] = this.numberToReturn &amp; 0xff;
_command[_index++] = (this.numberToReturn &gt;&gt; 8) &amp; 0xff;
_command[_index++] = (this.numberToReturn &gt;&gt; 16) &amp; 0xff;
_command[_index++] = (this.numberToReturn &gt;&gt; 24) &amp; 0xff;
// Encode the cursor id
var low_bits = this.cursorId.getLowBits();
// Encode low bits
_command[_index++] = low_bits &amp; 0xff;
_command[_index++] = (low_bits &gt;&gt; 8) &amp; 0xff;
_command[_index++] = (low_bits &gt;&gt; 16) &amp; 0xff;
_command[_index++] = (low_bits &gt;&gt; 24) &amp; 0xff;
var high_bits = this.cursorId.getHighBits();
// Encode high bits
_command[_index++] = high_bits &amp; 0xff;
_command[_index++] = (high_bits &gt;&gt; 8) &amp; 0xff;
_command[_index++] = (high_bits &gt;&gt; 16) &amp; 0xff;
_command[_index++] = (high_bits &gt;&gt; 24) &amp; 0xff;
// Return command
return _command;
};
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>

File Metadata

Mime Type
text/html
Expires
Fri, Nov 27, 16:23 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1209648
Default Alt Text
bin_node_modules_mongodb_lib_mongodb_commands_get_more_command.js.html (11 KB)

Event Timeline