diff options
| author | Jules Laplace <jules@okfoc.us> | 2012-09-24 16:22:07 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2012-09-24 16:22:07 -0400 |
| commit | 686106d544ecc3b6ffd4db2b665d3bc879a58d8c (patch) | |
| tree | a5b5e50237cef70e12f0745371896e96f5f6d578 /node_modules/mongodb/lib/mongodb/commands/base_command.js | |
ok
Diffstat (limited to 'node_modules/mongodb/lib/mongodb/commands/base_command.js')
| -rw-r--r-- | node_modules/mongodb/lib/mongodb/commands/base_command.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/node_modules/mongodb/lib/mongodb/commands/base_command.js b/node_modules/mongodb/lib/mongodb/commands/base_command.js new file mode 100644 index 0000000..6e531d3 --- /dev/null +++ b/node_modules/mongodb/lib/mongodb/commands/base_command.js @@ -0,0 +1,27 @@ +/** + Base object used for common functionality +**/ +var BaseCommand = exports.BaseCommand = function() { +}; + +var id = 1; +BaseCommand.prototype.getRequestId = function() { + if (!this.requestId) this.requestId = id++; + return this.requestId; +}; + +BaseCommand.prototype.updateRequestId = function() { + this.requestId = id++; + return this.requestId; +}; + +// OpCodes +BaseCommand.OP_REPLY = 1; +BaseCommand.OP_MSG = 1000; +BaseCommand.OP_UPDATE = 2001; +BaseCommand.OP_INSERT = 2002; +BaseCommand.OP_GET_BY_OID = 2003; +BaseCommand.OP_QUERY = 2004; +BaseCommand.OP_GET_MORE = 2005; +BaseCommand.OP_DELETE = 2006; +BaseCommand.OP_KILL_CURSORS = 2007;
\ No newline at end of file |
