~ps-jenkins/ubuntu-push/ubuntu-vivid-proposed

« back to all changes in this revision

Viewing changes to docs/example-server/node_modules/mongodb/lib/mongodb/index.js

  • Committer: Roberto Alsina
  • Date: 2014-09-05 14:57:17 UTC
  • mto: (91.179.25 automatic)
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: roberto.alsina@canonical.com-20140905145717-0ufcsv27w25i1nnu
added example app server

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
try {
 
2
  exports.BSONPure = require('bson').BSONPure;
 
3
  exports.BSONNative = require('bson').BSONNative;
 
4
} catch(err) {
 
5
  // do nothing
 
6
}
 
7
 
 
8
// export the driver version
 
9
exports.version = require('../../package').version;
 
10
 
 
11
[ 'commands/base_command'
 
12
  , 'admin'
 
13
  , 'collection'
 
14
  , 'connection/read_preference'
 
15
  , 'connection/connection'
 
16
  , 'connection/server'
 
17
  , 'connection/mongos'
 
18
  , 'connection/repl_set/repl_set'
 
19
  , 'mongo_client'
 
20
  , 'cursor'
 
21
  , 'db'
 
22
  , 'mongo_client'
 
23
  , 'gridfs/grid'
 
24
  ,     'gridfs/chunk'
 
25
  , 'gridfs/gridstore'].forEach(function (path) {
 
26
        var module = require('./' + path);
 
27
        for (var i in module) {
 
28
                exports[i] = module[i];
 
29
    }
 
30
});
 
31
 
 
32
// backwards compat
 
33
exports.ReplSetServers = exports.ReplSet;
 
34
// Add BSON Classes
 
35
exports.Binary = require('bson').Binary;
 
36
exports.Code = require('bson').Code;
 
37
exports.DBRef = require('bson').DBRef;
 
38
exports.Double = require('bson').Double;
 
39
exports.Long = require('bson').Long;
 
40
exports.MinKey = require('bson').MinKey;
 
41
exports.MaxKey = require('bson').MaxKey;
 
42
exports.ObjectID = require('bson').ObjectID;
 
43
exports.Symbol = require('bson').Symbol;
 
44
exports.Timestamp = require('bson').Timestamp;  
 
45
// Add BSON Parser
 
46
exports.BSON = require('bson').BSONPure.BSON;
 
47
 
 
48
// Set up the connect function
 
49
var connect = exports.Db.connect;
 
50
 
 
51
// Add the pure and native backward compatible functions
 
52
exports.pure = exports.native = function() {
 
53
  return connect;
 
54
}
 
55
 
 
56
// Map all values to the exports value
 
57
for(var name in exports) {
 
58
  connect[name] = exports[name];
 
59
}
 
60
 
 
61
// Set our exports to be the connect function
 
62
module.exports = connect;