Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var EventEmitter = require('events').EventEmitter
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto');
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory'];
/**
* @fileOverview The **Db** class is a class that represents a MongoDB Database.
*
* @example
* var MongoClient = require('mongodb').MongoClient,
* test = require('assert');
* // Connection url
var EventEmitter = require('events').EventEmitter
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto');
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory'];
/**
* @fileOverview The **Db** class is a class that represents a MongoDB Database.
*
* @example
* var MongoClient = require('mongodb').MongoClient,
* test = require('assert');
* // Connection url
var EventEmitter = require('events').EventEmitter
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto');
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory'];
/**
* @fileOverview The **Db** class is a class that represents a MongoDB Database.
*
* @example
* var MongoClient = require('mongodb').MongoClient,
* test = require('assert');
* // Connection url
var EventEmitter = require('events').EventEmitter
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto');
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory'];
/**
* @fileOverview The **Db** class is a class that represents a MongoDB Database.
*
* @example
* var MongoClient = require('mongodb').MongoClient,
* test = require('assert');
* // Connection url
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, filterOptions = require('./utils').filterOptions
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto')
, assign = require('./utils').assign;
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'promoteValues', 'promoteBuffers', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory', 'parentDb', 'promiseLibrary', 'noListener'];
// Filter out any write concern options
var illegalCommandFields = ['w', 'wtimeout', 'j', 'fsync', 'autoIndexId'
, 'strict', 'serializeFunctions', 'pkFactory', 'raw', 'readPreference'];
/**
* @fileOverview The **Db** class is a class that represents a MongoDB Database.
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, filterOptions = require('./utils').filterOptions
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto')
, mergeOptionsAndWriteConcern = require('./utils').mergeOptionsAndWriteConcern
, assign = require('./utils').assign;
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'promoteValues', 'promoteBuffers', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory', 'parentDb', 'promiseLibrary', 'noListener'];
// Filter out any write concern options
var illegalCommandFields = ['w', 'wtimeout', 'j', 'fsync', 'autoIndexId'
, 'strict', 'serializeFunctions', 'pkFactory', 'raw', 'readPreference'];
/**
'use strict';
const EventEmitter = require('events').EventEmitter;
const inherits = require('util').inherits;
const getSingleProperty = require('./utils').getSingleProperty;
const CommandCursor = require('./command_cursor');
const handleCallback = require('./utils').handleCallback;
const filterOptions = require('./utils').filterOptions;
const toError = require('./utils').toError;
const ReadPreference = require('mongodb-core').ReadPreference;
const MongoError = require('mongodb-core').MongoError;
const ObjectID = require('mongodb-core').ObjectID;
const Logger = require('mongodb-core').Logger;
const Collection = require('./collection');
const mergeOptionsAndWriteConcern = require('./utils').mergeOptionsAndWriteConcern;
const executeOperation = require('./utils').executeOperation;
const applyWriteConcern = require('./utils').applyWriteConcern;
const resolveReadPreference = require('./utils').resolveReadPreference;
const ChangeStream = require('./change_stream');
const deprecate = require('util').deprecate;
const deprecateOptions = require('./utils').deprecateOptions;
const CONSTANTS = require('./constants');
// Operations
const addUser = require('./operations/db_ops').addUser;
const collections = require('./operations/db_ops').collections;
const createCollection = require('./operations/db_ops').createCollection;
const createIndex = require('./operations/db_ops').createIndex;
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, filterOptions = require('./utils').filterOptions
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto')
, mergeOptionsAndWriteConcern = require('./utils').mergeOptionsAndWriteConcern
, assign = require('./utils').assign;
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'promoteValues', 'promoteBuffers', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory', 'parentDb', 'promiseLibrary', 'noListener'];
// Filter out any write concern options
var illegalCommandFields = ['w', 'wtimeout', 'j', 'fsync', 'autoIndexId'
, 'strict', 'serializeFunctions', 'pkFactory', 'raw', 'readPreference'];
/**
, inherits = require('util').inherits
, getSingleProperty = require('./utils').getSingleProperty
, shallowClone = require('./utils').shallowClone
, parseIndexOptions = require('./utils').parseIndexOptions
, debugOptions = require('./utils').debugOptions
, CommandCursor = require('./command_cursor')
, handleCallback = require('./utils').handleCallback
, filterOptions = require('./utils').filterOptions
, toError = require('./utils').toError
, ReadPreference = require('./read_preference')
, f = require('util').format
, Admin = require('./admin')
, Code = require('mongodb-core').BSON.Code
, CoreReadPreference = require('mongodb-core').ReadPreference
, MongoError = require('mongodb-core').MongoError
, ObjectID = require('mongodb-core').ObjectID
, Define = require('./metadata')
, Logger = require('mongodb-core').Logger
, Collection = require('./collection')
, crypto = require('crypto')
, mergeOptionsAndWriteConcern = require('./utils').mergeOptionsAndWriteConcern
, assign = require('./utils').assign;
var debugFields = ['authSource', 'w', 'wtimeout', 'j', 'native_parser', 'forceServerObjectId'
, 'serializeFunctions', 'raw', 'promoteLongs', 'promoteValues', 'promoteBuffers', 'bufferMaxEntries', 'numberOfRetries', 'retryMiliSeconds'
, 'readPreference', 'pkFactory', 'parentDb', 'promiseLibrary', 'noListener'];
// Filter out any write concern options
var illegalCommandFields = ['w', 'wtimeout', 'j', 'fsync', 'autoIndexId'
, 'strict', 'serializeFunctions', 'pkFactory', 'raw', 'readPreference'];
/**