From ade0e8895bd5ddb087d7214c903cb8c1bbc2f062 Mon Sep 17 00:00:00 2001 From: baileympearson <23407842+baileympearson@users.noreply.github.com> Date: Tue, 4 Mar 2025 21:22:22 +0000 Subject: [PATCH 1/2] [create-pull-request] automated change --- docs/404.html | 32 ++-- docs/Next/assets/navigation.js | 2 +- docs/Next/assets/search.js | 2 +- docs/Next/classes/AbstractCursor.html | 105 ++++++------- docs/Next/classes/AggregationCursor.html | 137 +++++++++-------- docs/Next/classes/BSON.ObjectId.html | 36 ++--- docs/Next/classes/Batch.html | 4 +- docs/Next/classes/BulkOperationBase.html | 10 +- docs/Next/classes/BulkWriteResult.html | 32 ++-- docs/Next/classes/CancellationToken.html | 66 ++++---- docs/Next/classes/ChangeStream.html | 74 ++++----- docs/Next/classes/ClientEncryption.html | 22 +-- docs/Next/classes/ClientSession.html | 95 ++++++------ docs/Next/classes/Collection.html | 119 +++++++------- docs/Next/classes/Db.html | 36 ++--- docs/Next/classes/ExplainableCursor.html | 103 +++++++------ docs/Next/classes/FindCursor.html | 145 +++++++++--------- docs/Next/classes/FindOperators.html | 22 +-- docs/Next/classes/GridFSBucket.html | 76 ++++----- docs/Next/classes/GridFSBucketReadStream.html | 6 +- .../Next/classes/GridFSBucketWriteStream.html | 6 +- docs/Next/classes/HostAddress.html | 4 +- docs/Next/classes/ListCollectionsCursor.html | 107 ++++++------- docs/Next/classes/ListIndexesCursor.html | 101 ++++++------ .../Next/classes/ListSearchIndexesCursor.html | 135 ++++++++-------- docs/Next/classes/MongoAPIError.html | 8 +- docs/Next/classes/MongoAWSError.html | 8 +- docs/Next/classes/MongoAzureError.html | 8 +- .../classes/MongoBatchReExecutionError.html | 8 +- docs/Next/classes/MongoBulkWriteError.html | 24 +-- docs/Next/classes/MongoChangeStreamError.html | 8 +- docs/Next/classes/MongoClient.html | 94 ++++++------ .../MongoClientBulkWriteCursorError.html | 8 +- .../classes/MongoClientBulkWriteError.html | 16 +- .../MongoClientBulkWriteExecutionError.html | 8 +- .../Next/classes/MongoCompatibilityError.html | 8 +- .../MongoCryptAzureKMSRequestError.html | 6 +- .../classes/MongoCryptCreateDataKeyError.html | 6 +- ...goCryptCreateEncryptedCollectionError.html | 6 +- docs/Next/classes/MongoCryptError.html | 6 +- .../MongoCryptInvalidArgumentError.html | 6 +- ...ngoCryptKMSRequestNetworkTimeoutError.html | 6 +- .../classes/MongoCursorExhaustedError.html | 8 +- docs/Next/classes/MongoCursorInUseError.html | 8 +- .../classes/MongoDBCollectionNamespace.html | 8 +- docs/Next/classes/MongoDBNamespace.html | 8 +- .../Next/classes/MongoDecompressionError.html | 8 +- docs/Next/classes/MongoDriverError.html | 8 +- docs/Next/classes/MongoError.html | 8 +- .../classes/MongoExpiredSessionError.html | 8 +- docs/Next/classes/MongoGCPError.html | 8 +- docs/Next/classes/MongoGridFSChunkError.html | 8 +- docs/Next/classes/MongoGridFSStreamError.html | 8 +- .../classes/MongoInvalidArgumentError.html | 8 +- docs/Next/classes/MongoKerberosError.html | 8 +- .../classes/MongoMissingCredentialsError.html | 8 +- .../classes/MongoMissingDependencyError.html | 10 +- docs/Next/classes/MongoNetworkError.html | 8 +- .../classes/MongoNetworkTimeoutError.html | 8 +- docs/Next/classes/MongoNotConnectedError.html | 8 +- docs/Next/classes/MongoOIDCError.html | 8 +- .../classes/MongoOperationTimeoutError.html | 8 +- docs/Next/classes/MongoParseError.html | 8 +- docs/Next/classes/MongoRuntimeError.html | 8 +- docs/Next/classes/MongoServerClosedError.html | 8 +- docs/Next/classes/MongoServerError.html | 10 +- .../classes/MongoServerSelectionError.html | 10 +- docs/Next/classes/MongoStalePrimaryError.html | 29 ++++ docs/Next/classes/MongoSystemError.html | 10 +- .../classes/MongoTailableCursorError.html | 8 +- .../classes/MongoTopologyClosedError.html | 8 +- docs/Next/classes/MongoTransactionError.html | 8 +- .../MongoUnexpectedServerResponseError.html | 8 +- docs/Next/classes/MongoWriteConcernError.html | 12 +- docs/Next/classes/OrderedBulkOperation.html | 8 +- docs/Next/classes/RunCommandCursor.html | 95 ++++++------ docs/Next/classes/ServerCapabilities.html | 4 +- docs/Next/classes/ServerDescription.html | 10 +- docs/Next/classes/ServerSession.html | 6 +- docs/Next/classes/TypedEventEmitter.html | 62 ++++---- docs/Next/classes/UnorderedBulkOperation.html | 8 +- docs/Next/classes/WriteConcernError.html | 10 +- docs/Next/classes/WriteError.html | 14 +- docs/Next/hierarchy.html | 2 +- docs/Next/index.html | 9 +- .../interfaces/AWSEncryptionKeyOptions.html | 8 +- .../interfaces/AbstractCursorOptions.html | 22 +-- docs/Next/interfaces/AggregateOptions.html | 10 +- .../interfaces/AggregationCursorOptions.html | 26 ++-- docs/Next/interfaces/Auth.html | 6 +- .../interfaces/AutoEncryptionOptions.html | 22 +-- .../interfaces/AzureEncryptionKeyOptions.html | 8 +- .../interfaces/BulkWriteOperationError.html | 4 +- docs/Next/interfaces/BulkWriteOptions.html | 20 +-- .../ChangeStreamCollModDocument.html | 16 +- .../ChangeStreamCreateDocument.html | 19 ++- .../ChangeStreamCreateIndexDocument.html | 18 +-- .../ChangeStreamDeleteDocument.html | 22 +-- .../ChangeStreamDocumentCollectionUUID.html | 4 +- .../ChangeStreamDocumentCommon.html | 12 +- .../interfaces/ChangeStreamDocumentKey.html | 4 +- ...ngeStreamDocumentOperationDescription.html | 4 +- .../ChangeStreamDropDatabaseDocument.html | 16 +- .../interfaces/ChangeStreamDropDocument.html | 18 +-- .../ChangeStreamDropIndexDocument.html | 18 +-- .../ChangeStreamInsertDocument.html | 22 +-- .../ChangeStreamInvalidateDocument.html | 14 +- .../interfaces/ChangeStreamNameSpace.html | 4 +- docs/Next/interfaces/ChangeStreamOptions.html | 28 ++-- ...treamRefineCollectionShardKeyDocument.html | 14 +- .../ChangeStreamRenameDocument.html | 20 +-- .../ChangeStreamReplaceDocument.html | 22 +-- ...ChangeStreamReshardCollectionDocument.html | 14 +- .../ChangeStreamShardCollectionDocument.html | 14 +- .../interfaces/ChangeStreamSplitEvent.html | 6 +- .../ChangeStreamUpdateDocument.html | 26 ++-- .../interfaces/ClientBulkWriteOptions.html | 10 +- ...ncryptionCreateDataKeyProviderOptions.html | 6 +- .../ClientEncryptionEncryptOptions.html | 14 +- .../interfaces/ClientEncryptionOptions.html | 14 +- ...ptionRewrapManyDataKeyProviderOptions.html | 4 +- ...ientEncryptionRewrapManyDataKeyResult.html | 4 +- .../Next/interfaces/ClientSessionOptions.html | 10 +- docs/Next/interfaces/CloseOptions.html | 4 +- docs/Next/interfaces/CollectionInfo.html | 4 +- docs/Next/interfaces/CollectionOptions.html | 8 +- .../interfaces/CommandOperationOptions.html | 10 +- docs/Next/interfaces/ConnectOptions.html | 4 +- docs/Next/interfaces/ConnectionOptions.html | 22 +-- .../interfaces/ConnectionPoolOptions.html | 32 ++-- .../interfaces/CountDocumentsOptions.html | 16 +- docs/Next/interfaces/CountOptions.html | 10 +- .../interfaces/CreateCollectionOptions.html | 10 +- .../Next/interfaces/CreateIndexesOptions.html | 10 +- docs/Next/interfaces/CursorStreamOptions.html | 4 +- docs/Next/interfaces/DbStatsOptions.html | 10 +- docs/Next/interfaces/DeleteManyModel.html | 8 +- docs/Next/interfaces/DeleteOneModel.html | 8 +- docs/Next/interfaces/DeleteOptions.html | 10 +- docs/Next/interfaces/DriverInfo.html | 4 +- .../interfaces/DropCollectionOptions.html | 10 +- docs/Next/interfaces/EndSessionOptions.html | 6 +- docs/Next/interfaces/ErrorDescription.html | 4 +- .../EstimatedDocumentCountOptions.html | 10 +- docs/Next/interfaces/FilterOperators.html | 6 +- .../interfaces/FindOneAndDeleteOptions.html | 10 +- .../interfaces/FindOneAndReplaceOptions.html | 10 +- .../interfaces/FindOneAndUpdateOptions.html | 10 +- docs/Next/interfaces/FindOptions.html | 10 +- .../interfaces/GCPEncryptionKeyOptions.html | 14 +- .../interfaces/IndexInformationOptions.html | 20 +-- docs/Next/interfaces/InsertOneModel.html | 4 +- docs/Next/interfaces/InsertOneOptions.html | 10 +- .../interfaces/KMIPEncryptionKeyOptions.html | 8 +- .../interfaces/ListCollectionsOptions.html | 29 +++- .../Next/interfaces/ListDatabasesOptions.html | 10 +- docs/Next/interfaces/Log.html | 5 + .../LogComponentSeveritiesClientOptions.html | 13 ++ docs/Next/interfaces/ModifyResult.html | 4 +- docs/Next/interfaces/MongoClientOptions.html | 127 +++++++-------- docs/Next/interfaces/MongoDBLogWritable.html | 18 +++ .../interfaces/MongoNetworkErrorOptions.html | 4 +- docs/Next/interfaces/MongoOptions.html | 76 ++++----- docs/Next/interfaces/MonitorOptions.html | 22 +-- docs/Next/interfaces/OperationOptions.html | 12 +- docs/Next/interfaces/PkFactory.html | 4 +- docs/Next/interfaces/ProxyOptions.html | 4 +- docs/Next/interfaces/RangeOptions.html | 10 +- docs/Next/interfaces/RenameOptions.html | 10 +- docs/Next/interfaces/ReplaceOneModel.html | 12 +- docs/Next/interfaces/ReplaceOptions.html | 10 +- docs/Next/interfaces/ResumeOptions.html | 4 +- docs/Next/interfaces/RootFilterOperators.html | 4 +- docs/Next/interfaces/SelectServerOptions.html | 6 +- docs/Next/interfaces/ServerApi.html | 4 +- docs/Next/interfaces/TransactionOptions.html | 6 +- docs/Next/interfaces/UpdateManyModel.html | 14 +- docs/Next/interfaces/UpdateOneModel.html | 14 +- docs/Next/interfaces/UpdateOptions.html | 10 +- .../interfaces/ValidateCollectionOptions.html | 10 +- .../interfaces/WriteConcernErrorData.html | 4 +- .../interfaces/WriteConcernErrorResult.html | 4 +- docs/Next/modules.html | 9 ++ docs/Next/types/Abortable.html | 13 ++ docs/Next/types/AbstractCursorEvents.html | 2 +- docs/Next/types/AcceptedFields.html | 2 +- docs/Next/types/AddToSetOperators.html | 2 +- docs/Next/types/AlternativeType.html | 2 +- docs/Next/types/AnyBulkWriteOperation.html | 2 +- docs/Next/types/ArrayElement.html | 2 +- docs/Next/types/ArrayOperator.html | 2 +- .../types/AutoEncryptionExtraOptions.html | 2 +- .../Next/types/AutoEncryptionLoggerLevel.html | 2 +- docs/Next/types/BSONTypeAlias.html | 2 +- docs/Next/types/BatchType.html | 2 +- docs/Next/types/BitwiseFilter.html | 2 +- docs/Next/types/CSFLEKMSTlsOptions.html | 2 +- docs/Next/types/Callback.html | 2 +- .../types/ClientEncryptionSocketOptions.html | 2 +- .../types/ClientEncryptionTlsOptions.html | 2 +- docs/Next/types/ClientSessionEvents.html | 2 +- docs/Next/types/CommonEvents.html | 2 +- docs/Next/types/Condition.html | 2 +- docs/Next/types/ConnectionEvents.html | 2 +- docs/Next/types/ConnectionPoolEvents.html | 2 +- docs/Next/types/CursorFlag.html | 2 +- docs/Next/types/CursorTimeoutMode.html | 2 +- docs/Next/types/EnhancedOmit.html | 2 +- docs/Next/types/EventEmitterWithState.html | 2 +- docs/Next/types/EventsDescription.html | 2 +- docs/Next/types/Filter.html | 2 +- docs/Next/types/FilterOperations.html | 2 +- docs/Next/types/Flatten.html | 2 +- docs/Next/types/GenericListener.html | 2 +- docs/Next/types/Hint.html | 2 +- docs/Next/types/InferIdType.html | 2 +- docs/Next/types/IntegerType.html | 2 +- docs/Next/types/IsAny.html | 2 +- docs/Next/types/Join.html | 2 +- docs/Next/types/KeysOfAType.html | 2 +- docs/Next/types/KeysOfOtherType.html | 2 +- docs/Next/types/MatchKeysAndValues.html | 2 +- docs/Next/types/MongoClientEvents.html | 2 +- docs/Next/types/MongoErrorLabel.html | 2 +- docs/Next/types/MongoLoggableComponent.html | 1 + docs/Next/types/MonitorEvents.html | 2 +- docs/Next/types/NestedPaths.html | 2 +- docs/Next/types/NestedPathsOfType.html | 2 +- docs/Next/types/NonObjectIdLikeDocument.html | 2 +- docs/Next/types/NotAcceptedFields.html | 2 +- docs/Next/types/NumericType.html | 2 +- docs/Next/types/OneOrMore.html | 2 +- docs/Next/types/OnlyFieldsOfType.html | 2 +- docs/Next/types/OperationTime.html | 2 +- docs/Next/types/OptionalId.html | 2 +- docs/Next/types/OptionalUnlessRequiredId.html | 2 +- docs/Next/types/PropertyType.html | 2 +- docs/Next/types/PullAllOperator.html | 2 +- docs/Next/types/PullOperator.html | 2 +- docs/Next/types/PushOperator.html | 2 +- docs/Next/types/RegExpOrString.html | 2 +- docs/Next/types/ResumeToken.html | 2 +- docs/Next/types/SchemaMember.html | 2 +- docs/Next/types/ServerApiVersion.html | 2 +- docs/Next/types/ServerEvents.html | 2 +- docs/Next/types/ServerMonitoringMode.html | 2 +- docs/Next/types/ServerSessionId.html | 2 +- docs/Next/types/SetFields.html | 2 +- docs/Next/types/SeverityLevel.html | 1 + docs/Next/types/StrictFilter.html | 2 +- docs/Next/types/StrictMatchKeysAndValues.html | 2 +- docs/Next/types/StrictUpdateFilter.html | 2 +- .../types/SupportedNodeConnectionOptions.html | 2 +- docs/Next/types/SupportedSocketOptions.html | 2 +- .../types/SupportedTLSConnectionOptions.html | 2 +- .../Next/types/SupportedTLSSocketOptions.html | 2 +- docs/Next/types/TopologyEvents.html | 2 +- docs/Next/types/UpdateFilter.html | 2 +- docs/Next/types/WithId.html | 2 +- docs/Next/types/WithSessionCallback.html | 2 +- docs/Next/types/WithTransactionCallback.html | 2 +- docs/Next/types/WithoutId.html | 2 +- .../AutoEncryptionLoggerLevel-1.html | 2 +- docs/Next/variables/BatchType-1.html | 2 +- docs/Next/variables/CURSOR_FLAGS.html | 2 +- docs/Next/variables/CursorTimeoutMode-1.html | 2 +- docs/Next/variables/MongoErrorLabel-1.html | 2 +- .../variables/MongoLoggableComponent-1.html | 1 + docs/Next/variables/ServerApiVersion-1.html | 2 +- .../variables/ServerMonitoringMode-1.html | 2 +- docs/Next/variables/SeverityLevel-1.html | 3 + docs/categories/index.xml | 7 +- docs/index.html | 34 ++-- docs/index.xml | 7 +- docs/sitemap.xml | 12 +- docs/tags/index.xml | 7 +- 276 files changed, 1948 insertions(+), 1820 deletions(-) create mode 100644 docs/Next/classes/MongoStalePrimaryError.html create mode 100644 docs/Next/interfaces/Log.html create mode 100644 docs/Next/interfaces/LogComponentSeveritiesClientOptions.html create mode 100644 docs/Next/interfaces/MongoDBLogWritable.html create mode 100644 docs/Next/types/Abortable.html create mode 100644 docs/Next/types/MongoLoggableComponent.html create mode 100644 docs/Next/types/SeverityLevel.html create mode 100644 docs/Next/variables/MongoLoggableComponent-1.html create mode 100644 docs/Next/variables/SeverityLevel-1.html diff --git a/docs/404.html b/docs/404.html index ef939e8cf63..1a8ae099da8 100644 --- a/docs/404.html +++ b/docs/404.html @@ -7,16 +7,16 @@ - +
AbstractAbstractStaticcaptureValue: boolean
+ProtectedsignalStaticcaptureValue: boolean
Change the default captureRejections option on all new EventEmitter objects.
Static ReadonlycaptureValue: Symbol.for('nodejs.rejection')
See how to write a custom rejection handler.
Static ReadonlyCLOSEStaticdefaultBy default, a maximum of 10 listeners can be registered for any single
+
Static ReadonlyCLOSEStaticdefaultBy default, a maximum of 10 listeners can be registered for any single
event. This limit can be changed for individual EventEmitter instances
using the emitter.setMaxListeners(n) method. To change the default
for allEventEmitter instances, the events.defaultMaxListeners property
@@ -90,57 +91,57 @@
regular 'error' listener is installed.
The cursor is closed and all remaining locally buffered documents have been iterated.
-The cursor has no id until it receives a response from the initial cursor creating command.
+A killCursors command was attempted on this cursor.
+
A killCursors command was attempted on this cursor.
This is performed if the cursor id is non zero.
Optional[captureRest...args: AnyRestOptional[captureRest...args: AnyRestAdd a cursor flag to the cursor
The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -.
The flag boolean value.
-Alias for emitter.on(eventName, listener).
Alias for emitter.on(eventName, listener).
Alias for emitter.on(eventName, listener).
Alias for emitter.on(eventName, listener).
Alias for emitter.on(eventName, listener).
Alias for emitter.on(eventName, listener).
Set the batch size for the cursor.
The number of documents to return per batch. See command documentation.
-AbstractcloneReturns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance
-Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments
+
AbstractcloneReturns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance
+Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
import { EventEmitter } from 'node:events';
const myEmitter = new EventEmitter();
// First listener
myEmitter.on('event', function firstListener() {
console.log('Helloooo! first listener');
});
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
});
// Third listener
myEmitter.on('event', function thirdListener(...args) {
const parameters = args.join(', ');
console.log(`event with parameters ${parameters} in third listener`);
});
console.log(myEmitter.listeners('event'));
myEmitter.emit('event', 1, 2, 3, 4, 5);
// Prints:
// [
// [Function: firstListener],
// [Function: secondListener],
// [Function: thirdListener]
// ]
// Helloooo! first listener
// event with parameters 1, 2 in second listener
// event with parameters 1, 2, 3, 4, 5 in third listener
Rest...args: Parameters<CursorEvents[EventKey]>Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or Symbols.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});
const sym = Symbol('symbol');
myEE.on(sym, () => {});
console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
Returns the current max listener value for the EventEmitter which is either
-set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.
Returns the current max listener value for the EventEmitter which is either
+set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.
Returns the number of listeners listening for the event named eventName.
+
Returns the number of listeners listening for the event named eventName.
If listener is provided, it will return how many times the listener is found
in the list of the listeners of the event.
Returns a copy of the array of listeners for the event named eventName.
Returns a copy of the array of listeners for the event named eventName.
server.on('connection', (stream) => {
console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]
Map all documents using the provided function +
Map all documents using the provided function If there is a transform set on the cursor, that will be called first and the result passed to this function's transform.
The mapping transformation method.
@@ -161,16 +162,16 @@const cursor: FindCursor<Document> = coll.find();
const mappedCursor: FindCursor<number> = cursor.map(doc => Object.keys(doc).length);
const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[]
-Alias for emitter.removeListener().
Alias for emitter.removeListener().
Alias for emitter.removeListener().
Alias for emitter.removeListener().
Alias for emitter.removeListener().
Alias for emitter.removeListener().
Adds the listener function to the end of the listeners array for the event
+
Adds the listener function to the end of the listeners array for the event
named eventName. No checks are made to see if the listener has already
been added. Multiple calls passing the same combination of eventName and
listener will result in the listener being added, and called, multiple times.
The callback function
Adds the listener function to the end of the listeners array for the event
+
Adds the listener function to the end of the listeners array for the event
named eventName. No checks are made to see if the listener has already
been added. Multiple calls passing the same combination of eventName and
listener will result in the listener being added, and called, multiple times.
The callback function
Adds the listener function to the end of the listeners array for the event
+
Adds the listener function to the end of the listeners array for the event
named eventName. No checks are made to see if the listener has already
been added. Multiple calls passing the same combination of eventName and
listener will result in the listener being added, and called, multiple times.
The callback function
Adds a one-time listener function for the event named eventName. The
+
Adds a one-time listener function for the event named eventName. The
next time eventName is triggered, this listener is removed and then invoked.
server.once('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -228,7 +229,7 @@ The callback function
Adds a one-time listener function for the event named eventName. The
+
Adds a one-time listener function for the event named eventName. The
next time eventName is triggered, this listener is removed and then invoked.
server.once('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -241,7 +242,7 @@ The callback function
Adds a one-time listener function for the event named eventName. The
+
Adds a one-time listener function for the event named eventName. The
next time eventName is triggered, this listener is removed and then invoked.
server.once('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -254,7 +255,7 @@ The callback function
Adds the listener function to the beginning of the listeners array for the
+
Adds the listener function to the beginning of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventName
and listener will result in the listener being added, and called, multiple times.
EventEmitter, so that calls can be chained.
The callback function
Adds the listener function to the beginning of the listeners array for the
+
Adds the listener function to the beginning of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventName
and listener will result in the listener being added, and called, multiple times.
EventEmitter, so that calls can be chained.
The callback function
Adds the listener function to the beginning of the listeners array for the
+
Adds the listener function to the beginning of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventName
and listener will result in the listener being added, and called, multiple times.
EventEmitter, so that calls can be chained.
The callback function
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
+
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
listener is removed, and then invoked.
server.prependOnceListener('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -292,7 +293,7 @@ EventEmitter, so that calls can be chained.
The callback function
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
+
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
listener is removed, and then invoked.
server.prependOnceListener('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -300,7 +301,7 @@ EventEmitter, so that calls can be chained.
The callback function
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
+
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
listener is removed, and then invoked.
server.prependOnceListener('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -308,20 +309,20 @@ EventEmitter, so that calls can be chained.
The callback function
Returns a copy of the array of listeners for the event named eventName,
+
Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
import { EventEmitter } from 'node:events';
const emitter = new EventEmitter();
emitter.once('log', () => console.log('log once'));
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
const listeners = emitter.rawListeners('log');
const logFnWrapper = listeners[0];
// Logs "log once" to the console and does not unbind the `once` event
logFnWrapper.listener();
// Logs "log once" to the console and removes the listener
logFnWrapper();
emitter.on('log', () => console.log('log persistently'));
// Will return a new Array with a single function bound by `.on()` above
const newListeners = emitter.rawListeners('log');
// Logs "log persistently" twice
newListeners[0]();
emitter.emit('log');
Removes all listeners, or those of the specified eventName.
Removes all listeners, or those of the specified eventName.
It is bad practice to remove listeners added elsewhere in the code,
particularly when the EventEmitter instance was created by some other
component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
Optionalevent: string | symbol | EventKeyRemoves the specified listener from the listener array for the event named eventName.
Removes the specified listener from the listener array for the event named eventName.
const callback = (stream) => {
console.log('someone connected!');
};
server.on('connection', callback);
// ...
server.removeListener('connection', callback);
@@ -348,7 +349,7 @@ EventEmitter, so that calls can be chained.
Removes the specified listener from the listener array for the event named eventName.
Removes the specified listener from the listener array for the event named eventName.
const callback = (stream) => {
console.log('someone connected!');
};
server.on('connection', callback);
// ...
server.removeListener('connection', callback);
@@ -375,7 +376,7 @@ EventEmitter, so that calls can be chained.
Removes the specified listener from the listener array for the event named eventName.
Removes the specified listener from the listener array for the event named eventName.
const callback = (stream) => {
console.log('someone connected!');
};
server.on('connection', callback);
// ...
server.removeListener('connection', callback);
@@ -402,24 +403,24 @@ EventEmitter, so that calls can be chained.
By default EventEmitters will print a warning if more than 10 listeners are
added for a particular event. This is a useful default that helps finding
memory leaks. The emitter.setMaxListeners() method allows the limit to be
modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter, so that calls can be chained.
Optionaloptions: CursorStreamOptionsReturns an array of documents. The caller is responsible for making sure that there +
Optionaloptions: CursorStreamOptionsReturns an array of documents. The caller is responsible for making sure that there is enough memory to store the results. Note that the array only contains partial results when this cursor had been previously accessed. In that case, cursor.rewind() can be used to reset the cursor.
-Set the ReadPreference for the cursor.
-Set the ReadPreference for the cursor.
+Set the ReadPreference for the cursor.
+Set the ReadPreference for the cursor.
The new read preference for the cursor.
-StaticaddStaticadd
An alias for AbstractCursor.close|AbstractCursor.close().
-