This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 106
/
index.js
50 lines (47 loc) · 1.84 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'use strict';
var BSON = require('bson');
var require_optional = require('require_optional');
const EJSON = require('./lib/utils').retrieveEJSON();
try {
// Attempt to grab the native BSON parser
var BSONNative = require_optional('bson-ext');
// If we got the native parser, use it instead of the
// Javascript one
if (BSONNative) {
BSON = BSONNative;
}
} catch (err) {} // eslint-disable-line
module.exports = {
// Errors
MongoError: require('./lib/error').MongoError,
MongoNetworkError: require('./lib/error').MongoNetworkError,
MongoParseError: require('./lib/error').MongoParseError,
MongoTimeoutError: require('./lib/error').MongoTimeoutError,
MongoWriteConcernError: require('./lib/error').MongoWriteConcernError,
mongoErrorContextSymbol: require('./lib/error').mongoErrorContextSymbol,
// Core
Connection: require('./lib/connection/connection'),
Server: require('./lib/topologies/server'),
ReplSet: require('./lib/topologies/replset'),
Mongos: require('./lib/topologies/mongos'),
Logger: require('./lib/connection/logger'),
Cursor: require('./lib/cursor'),
ReadPreference: require('./lib/topologies/read_preference'),
Sessions: require('./lib/sessions'),
BSON: BSON,
EJSON: EJSON,
Topology: require('./lib/sdam/topology'),
// Raw operations
Query: require('./lib/connection/commands').Query,
// Auth mechanisms
MongoCredentials: require('./lib/auth/mongo_credentials').MongoCredentials,
defaultAuthProviders: require('./lib/auth/defaultAuthProviders').defaultAuthProviders,
MongoCR: require('./lib/auth/mongocr'),
X509: require('./lib/auth/x509'),
Plain: require('./lib/auth/plain'),
GSSAPI: require('./lib/auth/gssapi'),
ScramSHA1: require('./lib/auth/scram').ScramSHA1,
ScramSHA256: require('./lib/auth/scram').ScramSHA256,
// Utilities
parseConnectionString: require('./lib/uri_parser')
};