PageRenderTime 71ms CodeModel.GetById 32ms app.highlight 15ms RepoModel.GetById 5ms app.codeStats 0ms

/node_modules/mongodb/lib/mongodb/index.js

https://bitbucket.org/gagginaspinnata/todo-app-with-angularjs
JavaScript | 151 lines | 121 code | 14 blank | 16 comment | 3 complexity | 282d67a447cd745871b5a7b834ef99e0 MD5 | raw file
Possible License(s): Apache-2.0, MIT
  1try {
  2  exports.BSONPure = require('bson').BSONPure;
  3  exports.BSONNative = require('bson').BSONNative;
  4} catch(err) {
  5  // do nothing
  6}
  7
  8[ 'commands/base_command'
  9  , 'commands/db_command'
 10  , 'commands/delete_command'
 11  , 'commands/get_more_command'
 12  , 'commands/insert_command'
 13  , 'commands/kill_cursor_command'
 14  , 'commands/query_command'
 15  , 'commands/update_command'
 16  , 'responses/mongo_reply'
 17  , 'admin'
 18  , 'collection'
 19  , 'connection/connection'
 20  , 'connection/server'
 21  , 'connection/repl_set'
 22  , 'cursor'
 23  , 'db'
 24  , 'gridfs/grid'
 25  ,	'gridfs/chunk'
 26  , 'gridfs/gridstore'].forEach(function (path) {
 27  	var module = require('./' + path);
 28  	for (var i in module) {
 29  		exports[i] = module[i];
 30    }
 31
 32    // backwards compat
 33    exports.ReplSetServers = exports.ReplSet;
 34    
 35    // Add BSON Classes
 36    exports.Binary = require('bson').Binary;
 37    exports.Code = require('bson').Code;
 38    exports.DBRef = require('bson').DBRef;
 39    exports.Double = require('bson').Double;
 40    exports.Long = require('bson').Long;
 41    exports.MinKey = require('bson').MinKey;
 42    exports.MaxKey = require('bson').MaxKey;
 43    exports.ObjectID = require('bson').ObjectID;
 44    exports.Symbol = require('bson').Symbol;
 45    exports.Timestamp = require('bson').Timestamp;  
 46    
 47    // Add BSON Parser
 48    exports.BSON = require('bson').BSONPure.BSON;
 49});
 50
 51// Exports all the classes for the PURE JS BSON Parser
 52exports.pure = function() {
 53  var classes = {};
 54  // Map all the classes
 55  [ 'commands/base_command'
 56    , 'commands/db_command'
 57    , 'commands/delete_command'
 58    , 'commands/get_more_command'
 59    , 'commands/insert_command'
 60    , 'commands/kill_cursor_command'
 61    , 'commands/query_command'
 62    , 'commands/update_command'
 63    , 'responses/mongo_reply'
 64    , 'admin'
 65    , 'collection'
 66    , 'connection/connection'
 67    , 'connection/server'
 68    , 'connection/repl_set'
 69    , 'cursor'
 70    , 'db'
 71    , 'gridfs/grid'
 72    ,	'gridfs/chunk'
 73    , 'gridfs/gridstore'].forEach(function (path) {
 74    	var module = require('./' + path);
 75    	for (var i in module) {
 76    		classes[i] = module[i];
 77      }
 78  });
 79
 80  // backwards compat
 81  classes.ReplSetServers = exports.ReplSet;
 82
 83  // Add BSON Classes
 84  classes.Binary = require('bson').Binary;
 85  classes.Code = require('bson').Code;
 86  classes.DBRef = require('bson').DBRef;
 87  classes.Double = require('bson').Double;
 88  classes.Long = require('bson').Long;
 89  classes.MinKey = require('bson').MinKey;
 90  classes.MaxKey = require('bson').MaxKey;
 91  classes.ObjectID = require('bson').ObjectID;
 92  classes.Symbol = require('bson').Symbol;
 93  classes.Timestamp = require('bson').Timestamp;
 94
 95  // Add BSON Parser
 96  classes.BSON = require('bson').BSONPure.BSON;
 97
 98  // Return classes list
 99  return classes;
100}
101
102// Exports all the classes for the PURE JS BSON Parser
103exports.native = function() {
104  var classes = {};
105  // Map all the classes
106  [ 'commands/base_command'
107    , 'commands/db_command'
108    , 'commands/delete_command'
109    , 'commands/get_more_command'
110    , 'commands/insert_command'
111    , 'commands/kill_cursor_command'
112    , 'commands/query_command'
113    , 'commands/update_command'
114    , 'responses/mongo_reply'
115    , 'admin'
116    , 'collection'
117    , 'connection/connection'
118    , 'connection/server'
119    , 'connection/repl_set'
120    , 'cursor'
121    , 'db'
122    , 'gridfs/grid'
123    ,	'gridfs/chunk'
124    , 'gridfs/gridstore'].forEach(function (path) {
125    	var module = require('./' + path);
126    	for (var i in module) {
127    		classes[i] = module[i];
128      }
129  });
130
131  // Add BSON Classes
132  classes.Binary = require('bson').Binary;
133  classes.Code = require('bson').Code;
134  classes.DBRef = require('bson').DBRef;
135  classes.Double = require('bson').Double;
136  classes.Long = require('bson').Long;
137  classes.MinKey = require('bson').MinKey;
138  classes.MaxKey = require('bson').MaxKey;
139  classes.ObjectID = require('bson').ObjectID;
140  classes.Symbol = require('bson').Symbol;
141  classes.Timestamp = require('bson').Timestamp;
142
143  // backwards compat
144  classes.ReplSetServers = exports.ReplSet;
145
146  // Add BSON Parser
147  classes.BSON = require('bson').BSONNative.BSON;
148
149  // Return classes list
150  return classes;
151}