(protected) new EventStoreNodeConnection()
- Source:
Methods
appendToStream(stream, expectedVersion, events, userCredentialsopt) → {Promise.<WriteResult>}
Append events to a stream (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | The name of the stream to which to append. | |
expectedVersion |
number | The version at which we currently expect the stream to be in order that an optimistic concurrency check can be performed. | |
events |
Array.<EventData> | EventData | The event(s) to append. | |
userCredentials |
UserCredentials |
<optional> |
User credentials |
- Source:
Returns:
- Type
- Promise.<WriteResult>
close()
Close connection
- Source:
commitTransaction(transaction, userCredentials) → {Promise.<WriteResult>}
Commit a transaction
Parameters:
Name | Type | Description |
---|---|---|
transaction |
||
userCredentials |
- Source:
Returns:
- Type
- Promise.<WriteResult>
connect() → {Promise}
Start connection task
- Source:
Returns:
- Type
- Promise
connectToPersistentSubscription(stream, groupName, eventAppeared, subscriptionDroppedopt, userCredentialsopt, bufferSizeopt, autoAckopt) → {EventStorePersistentSubscription}
Subscribe to a persistent subscription
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
groupName |
string | ||
eventAppeared |
function | ||
subscriptionDropped |
function |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
|
bufferSize |
number |
<optional> |
|
autoAck |
boolean |
<optional> |
- Source:
Returns:
- Type
- EventStorePersistentSubscription
continueTransaction(transactionId, userCredentials) → {EventStoreTransaction}
Continue a transaction
Parameters:
Name | Type | Description |
---|---|---|
transactionId |
number | |
userCredentials |
UserCredentials |
- Source:
Returns:
createPersistentSubscription(stream, groupName, settings, userCredentialsopt) → {Promise.<PersistentSubscriptionCreateResult>}
Create a persistent subscription
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
groupName |
string | ||
settings |
PersistentSubscriptionSettings | ||
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<PersistentSubscriptionCreateResult>
deletePersistentSubscription(stream, groupName, userCredentialsopt) → {Promise.<PersistentSubscriptionDeleteResult>}
Delete a persistent subscription
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
groupName |
string | ||
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<PersistentSubscriptionDeleteResult>
deleteStream(stream, expectedVersion, hardDeleteopt, userCredentialsopt) → {Promise.<DeleteResult>}
Delete a stream (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
expectedVersion |
number | ||
hardDelete |
boolean |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<DeleteResult>
getStreamMetadataRaw(stream, userCredentialsopt) → {Promise.<RawStreamMetadataResult>}
Get stream metadata as raw object (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<RawStreamMetadataResult>
readAllEventsBackward(position, maxCount, resolveLinkTosopt, userCredentialsopt) → {Promise.<AllEventsSlice>}
Reading all events backwards (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
position |
Position | ||
maxCount |
number | ||
resolveLinkTos |
boolean |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<AllEventsSlice>
readAllEventsForward(position, maxCount, resolveLinkTosopt, userCredentialsopt) → {Promise.<AllEventsSlice>}
Reading all events forwards (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
position |
Position | ||
maxCount |
number | ||
resolveLinkTos |
boolean |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<AllEventsSlice>
readEvent(stream, eventNumber, resolveLinkTosopt, userCredentialsopt) → {Promise.<EventReadResult>}
Read a single event (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
eventNumber |
number | ||
resolveLinkTos |
boolean |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<EventReadResult>
readStreamEventsBackward(stream, start, count, resolveLinkTosopt, userCredentialsopt) → {Promise.<StreamEventsSlice>}
Reading a specific stream backwards (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
start |
number | ||
count |
number | ||
resolveLinkTos |
boolean |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<StreamEventsSlice>
readStreamEventsForward(stream, start, count, resolveLinkTosopt, userCredentialsopt) → {Promise.<StreamEventsSlice>}
Reading a specific stream forwards (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
start |
number | ||
count |
number | ||
resolveLinkTos |
boolean |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<StreamEventsSlice>
setStreamMetadataRaw(stream, expectedMetastreamVersion, metadata, userCredentialsopt) → {Promise.<WriteResult>}
Set stream metadata with raw object (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
expectedMetastreamVersion |
number | ||
metadata |
object | ||
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<WriteResult>
startTransaction(stream, expectedVersion, userCredentialsopt) → {Promise.<EventStoreTransaction>}
Start a transaction (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
expectedVersion |
number | ||
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<EventStoreTransaction>
subscribeToAll(resolveLinkTosnon-null, eventAppearednon-null, subscriptionDroppedopt, userCredentialsopt) → {Promise.<EventStoreSubscription>}
Subscribe to all (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
resolveLinkTos |
boolean | ||
eventAppeared |
function | ||
subscriptionDropped |
function |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<EventStoreSubscription>
subscribeToAllFrom(lastCheckpointnullable, resolveLinkTosnon-null, eventAppearednon-null, liveProcessingStartedopt, subscriptionDroppedopt, userCredentialsopt, readBatchSizeopt, non-null) → {EventStoreAllCatchUpSubscription}
Subscribe to all from
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
lastCheckpoint |
Position |
<nullable> |
|
resolveLinkTos |
boolean | ||
eventAppeared |
function | ||
liveProcessingStarted |
function |
<optional> |
|
subscriptionDropped |
function |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
|
readBatchSize |
number |
<optional> |
- Source:
Returns:
- Type
- EventStoreAllCatchUpSubscription
subscribeToStream(streamnon-null, resolveLinkTosnon-null, eventAppeared, subscriptionDroppedopt, userCredentialsopt) → {Promise.<EventStoreSubscription>}
Subscribe to a stream (async)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
resolveLinkTos |
boolean | ||
eventAppeared |
function | ||
subscriptionDropped |
function |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<EventStoreSubscription>
subscribeToStreamFrom(streamnon-null, lastCheckpointnullable, resolveLinkTosnon-null, eventAppearednon-null, liveProcessingStartedopt, subscriptionDroppedopt, userCredentialsopt, readBatchSizeopt, non-null) → {EventStoreStreamCatchUpSubscription}
Subscribe to a stream from position
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
lastCheckpoint |
number |
<nullable> |
|
resolveLinkTos |
boolean | ||
eventAppeared |
function | ||
liveProcessingStarted |
function |
<optional> |
|
subscriptionDropped |
function |
<optional> |
|
userCredentials |
UserCredentials |
<optional> |
|
readBatchSize |
number |
<optional> |
- Source:
Returns:
- Type
- EventStoreStreamCatchUpSubscription
updatePersistentSubscription(stream, groupName, settings, userCredentialsopt) → {Promise.<PersistentSubscriptionUpdateResult>}
Update a persistent subscription
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stream |
string | ||
groupName |
string | ||
settings |
string | ||
userCredentials |
UserCredentials |
<optional> |
- Source:
Returns:
- Type
- Promise.<PersistentSubscriptionUpdateResult>