diff --git a/docs/Next/classes/AbstractCursor.html b/docs/Next/classes/AbstractCursor.html index eee81cb00a8..05f42d05804 100644 --- a/docs/Next/classes/AbstractCursor.html +++ b/docs/Next/classes/AbstractCursor.html @@ -1,4 +1,4 @@ -
Abstract
Abstract
Protected
signalStatic
captureValue: boolean
+Protected
signalStatic
captureValue: boolean
Change the default captureRejections
option on all new EventEmitter
objects.
Static
Readonly
captureValue: Symbol.for('nodejs.rejection')
See how to write a custom rejection handler
.
Static
Readonly
CLOSEStatic
defaultBy default, a maximum of 10
listeners can be registered for any single
+
Static
Readonly
CLOSEStatic
defaultBy 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
@@ -91,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.
-Abstract
cloneReturns 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
+
Abstract
cloneReturns 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 Symbol
s.
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 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.
@@ -162,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!');
});
@@ -229,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!');
});
@@ -242,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!');
});
@@ -255,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!');
});
@@ -293,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!');
});
@@ -301,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!');
});
@@ -309,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.
Optional
event: 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);
@@ -349,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);
@@ -376,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);
@@ -403,24 +403,24 @@ EventEmitter
, so that calls can be chained.
By default EventEmitter
s 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.
Optional
options: CursorStreamOptionsReturns an array of documents. The caller is responsible for making sure that there +
Optional
options: 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.
-Static
addStatic
addExperimental
Listens once to the abort
event on the provided signal
.
Listening to the abort
event on abort signals is unsafe and may
lead to resource leaks since another third party with the signal can
call e.stopImmediatePropagation()
. Unfortunately Node.js cannot change
diff --git a/docs/Next/classes/Admin.html b/docs/Next/classes/Admin.html
index a78dddf7f80..15fd3301d56 100644
--- a/docs/Next/classes/Admin.html
+++ b/docs/Next/classes/Admin.html
@@ -4,7 +4,7 @@
Retrieve the server build information
Optional
options: CommandOperationOptionsOptional settings for the command
-Execute a command
+Execute a command
The driver will ensure the following fields are attached to the command sent to the server:
lsid
- sourced from an implicit session or options.sessionAttaching any of the above fields to the command will have no effect as the driver will overwrite the value.
The command to execute
Optional
options: RunCommandOptionsOptional settings for the command
-List the available databases
+List the available databases
Optional
options: ListDatabasesOptionsOptional settings for the command
-Ping the MongoDB server and retrieve results
+Ping the MongoDB server and retrieve results
Optional
options: CommandOperationOptionsOptional settings for the command
-Remove a user from a database
The username to remove
Optional
options: RemoveUserOptionsOptional settings for the command
-Get ReplicaSet status
+Get ReplicaSet status
Optional
options: CommandOperationOptionsOptional settings for the command
-Retrieve the server build information
+Retrieve the server build information
Optional
options: CommandOperationOptionsOptional settings for the command
-Retrieve this db's server status.
+Retrieve this db's server status.
Optional
options: CommandOperationOptionsOptional settings for the command
-Validate an existing collection
+Validate an existing collection
The name of the collection to validate.
Optional settings for the command
-An alias for AbstractCursor.close|AbstractCursor.close().
-Readonly
pipelineProtected
signalStatic
captureValue: boolean
+Readonly
pipelineProtected
signalStatic
captureValue: boolean
Change the default captureRejections
option on all new EventEmitter
objects.
Static
Readonly
captureValue: Symbol.for('nodejs.rejection')
See how to write a custom rejection handler
.
Static
Readonly
CLOSEStatic
defaultBy default, a maximum of 10
listeners can be registered for any single
+
Static
Readonly
CLOSEStatic
defaultBy 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
@@ -110,72 +110,72 @@
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)
.
Add a stage to the aggregation pipeline
Set the batch size for the cursor.
+Set the batch size for the cursor.
The number of documents to return per batch. See command documentation.
-Returns 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
+
Returns 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<AbstractCursorEvents[EventKey]>Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or Symbol
s.
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) ]
Execute the explain for the cursor
-Execute the explain for the cursor
-Execute the explain for the cursor
-Optional
timeoutMS?: numberExecute the explain for the cursor
-Optional
timeoutMS?: numberExecute the explain for the cursor
+Execute the explain for the cursor
+Execute the explain for the cursor
+Optional
timeoutMS?: numberExecute the explain for the cursor
+Optional
timeoutMS?: numberAdd a geoNear stage to the aggregation pipeline
-Add a geoNear stage to the aggregation pipeline
+Returns the current max listener value for the EventEmitter
which is either
set by emitter.setMaxListeners(n)
or defaults to EventEmitter.defaultMaxListeners.
Add a group stage to the aggregation pipeline
-Returns the number of listeners listening for the event named eventName
.
+
Add a group stage to the aggregation pipeline
+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] ]
Add a lookup stage to the aggregation pipeline
-Map all documents using the provided function +
Add a lookup stage to the aggregation pipeline
+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.
@@ -196,17 +196,17 @@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[]
-Add a match stage to the aggregation pipeline
-Add a match stage to the aggregation pipeline
+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!');
});
@@ -264,7 +264,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!');
});
@@ -277,7 +277,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!');
});
@@ -290,8 +290,8 @@ 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!');
});
@@ -329,7 +329,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!');
});
@@ -337,7 +337,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!');
});
@@ -345,7 +345,7 @@ EventEmitter
, so that calls can be chained.
The callback function
Add a project stage to the aggregation pipeline
+Add a project stage to the aggregation pipeline
In order to strictly type this function you must provide an interface that represents the effect of your projection on the result documents.
By default chaining a projection to your cursor changes the returned type to the generic Document type. @@ -356,21 +356,21 @@
const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]);
const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true });
const aPropOnlyArray: {a: number}[] = await projectCursor.toArray();
// or always use chaining and save the final cursor
const cursor = coll.aggregate().project<{ a: string }>({
_id: 0,
a: { $convert: { input: '$a', to: 'string' }
}});
-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');
Add a redact stage to the aggregation pipeline
-Removes all listeners, or those of the specified eventName
.
Add a redact stage to the aggregation pipeline
+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.
Optional
event: 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);
@@ -397,7 +397,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);
@@ -424,7 +424,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);
@@ -451,27 +451,27 @@ EventEmitter
, so that calls can be chained.
Protected
resolveOptional
verbosity: ExplainVerbosityLike | ExplainCommandOptions | { Optional
options: { Optional
timeoutMS?: numberOptional
explain?: ExplainVerbosityLike | ExplainCommandOptionsOptional
timeout?: { Optional
timeoutMS?: numberProtected
resolveOptional
verbosity: ExplainVerbosityLike | ExplainCommandOptions | { Optional
options: { Optional
timeoutMS?: numberOptional
explain?: ExplainVerbosityLike | ExplainCommandOptionsOptional
timeout?: { Optional
timeoutMS?: numberBy default EventEmitter
s 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.
Add a sort stage to the aggregation pipeline
-Optional
options: CursorStreamOptionsReturns an array of documents. The caller is responsible for making sure that there +
Add a sort stage to the aggregation pipeline
+Optional
options: 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.
-Add a unwind stage to the aggregation pipeline
-Set the ReadPreference for the cursor.
-Set the ReadPreference for the cursor.
+Add a unwind stage to the aggregation pipeline
+Set the ReadPreference for the cursor.
+Set the ReadPreference for the cursor.
The new read preference for the cursor.
-Static
addStatic
addExperimental
Listens once to the abort
event on the provided signal
.
Listening to the abort
event on abort signals is unsafe and may
lead to resource leaks since another third party with the signal can
call e.stopImmediatePropagation()
. Unfortunately Node.js cannot change
diff --git a/docs/Next/classes/Batch.html b/docs/Next/classes/Batch.html
index 380121052aa..c8019055d5b 100644
--- a/docs/Next/classes/Batch.html
+++ b/docs/Next/classes/Batch.html
@@ -1,6 +1,6 @@
An alias for AbstractCursor.close|AbstractCursor.close().
-