@valkyriestudios/mongo
Version:
MongoDB Adapter Library
42 lines (41 loc) • 1.76 kB
JavaScript
/**
* MongoDB Protocols
*
* https://www.mongodb.com/docs/manual/reference/connection-string/#std-label-connections-standard-connection-string-format
* https://www.mongodb.com/docs/manual/reference/connection-string/#std-label-connections-dns-seedlist
*/
export var Protocols;
(function (Protocols) {
/* Protocol for connection string that specifies all hosts */
Protocols["STANDARD"] = "mongodb";
/* Protocol for hostname that corresponds to a DNS SRV record (eg: Atlas deployments) with a seedlist */
Protocols["SRV"] = "mongodb+srv";
})(Protocols || (Protocols = {}));
/**
* MongoDB Read Preferences: How we want to balance our load
*
* https://www.mongodb.com/docs/manual/core/read-preference/
*/
export var ReadPreferences;
(function (ReadPreferences) {
/* All operations read from the current replica set primary */
ReadPreferences["PRIMARY"] = "primary";
/* Read from primary but fallback to secondary if unavailable */
ReadPreferences["PRIMARY_PREFERRED"] = "primaryPreferred";
/* All operations read from the secondary members of the replica set */
ReadPreferences["SECONDARY"] = "secondary";
/* Operations typically read data from secondary members of the replica set, falls back to primary */
ReadPreferences["SECONDARY_PREFERRED"] = "secondaryPreferred";
/* Operations read from a random eligible replica set member, based on a specified latency threshold */
ReadPreferences["NEAREST"] = "nearest";
})(ReadPreferences || (ReadPreferences = {}));
/**
* LogLevel enumeration
*/
export var LogLevel;
(function (LogLevel) {
LogLevel["DEBUG"] = "debug";
LogLevel["INFO"] = "info";
LogLevel["WARN"] = "warn";
LogLevel["ERROR"] = "error";
})(LogLevel || (LogLevel = {}));