Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';
  2. var BSON = require('bson');
  3. var require_optional = require('require_optional');
  4. const EJSON = require('./lib/utils').retrieveEJSON();
  5. try {
  6. // Attempt to grab the native BSON parser
  7. var BSONNative = require_optional('bson-ext');
  8. // If we got the native parser, use it instead of the
  9. // Javascript one
  10. if (BSONNative) {
  11. BSON = BSONNative;
  12. }
  13. } catch (err) {} // eslint-disable-line
  14. module.exports = {
  15. // Errors
  16. MongoError: require('./lib/error').MongoError,
  17. MongoNetworkError: require('./lib/error').MongoNetworkError,
  18. MongoParseError: require('./lib/error').MongoParseError,
  19. MongoTimeoutError: require('./lib/error').MongoTimeoutError,
  20. MongoWriteConcernError: require('./lib/error').MongoWriteConcernError,
  21. mongoErrorContextSymbol: require('./lib/error').mongoErrorContextSymbol,
  22. // Core
  23. Connection: require('./lib/connection/connection'),
  24. Server: require('./lib/topologies/server'),
  25. ReplSet: require('./lib/topologies/replset'),
  26. Mongos: require('./lib/topologies/mongos'),
  27. Logger: require('./lib/connection/logger'),
  28. Cursor: require('./lib/cursor'),
  29. ReadPreference: require('./lib/topologies/read_preference'),
  30. Sessions: require('./lib/sessions'),
  31. BSON: BSON,
  32. EJSON: EJSON,
  33. // Raw operations
  34. Query: require('./lib/connection/commands').Query,
  35. // Auth mechanisms
  36. defaultAuthProviders: require('./lib/auth/defaultAuthProviders').defaultAuthProviders,
  37. MongoCR: require('./lib/auth/mongocr'),
  38. X509: require('./lib/auth/x509'),
  39. Plain: require('./lib/auth/plain'),
  40. GSSAPI: require('./lib/auth/gssapi'),
  41. ScramSHA1: require('./lib/auth/scram').ScramSHA1,
  42. ScramSHA256: require('./lib/auth/scram').ScramSHA256,
  43. // Utilities
  44. parseConnectionString: require('./lib/uri_parser')
  45. };