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.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. Topology: require('./lib/sdam/topology'),
  34. // Raw operations
  35. Query: require('./lib/connection/commands').Query,
  36. // Auth mechanisms
  37. MongoCredentials: require('./lib/auth/mongo_credentials').MongoCredentials,
  38. defaultAuthProviders: require('./lib/auth/defaultAuthProviders').defaultAuthProviders,
  39. MongoCR: require('./lib/auth/mongocr'),
  40. X509: require('./lib/auth/x509'),
  41. Plain: require('./lib/auth/plain'),
  42. GSSAPI: require('./lib/auth/gssapi'),
  43. ScramSHA1: require('./lib/auth/scram').ScramSHA1,
  44. ScramSHA256: require('./lib/auth/scram').ScramSHA256,
  45. // Utilities
  46. parseConnectionString: require('./lib/uri_parser')
  47. };