The constructor of the service.
This method executes a count query using the {@link model}
argument.
Caution: Count queries require a considerable amount of RAM
to execute. It is preferred to use pro-active statistics with
collections that contain one document with a counter.
The number of matching accounts.
This method updates exactly one document in a collection.
The query configuration with sort
, order
, pageNumber
, pageSize
.
The fields or data that has to be updated (will be added to $set: {}
).
The operations that must be run additionally (e.g. $inc: {}
) (optional).
The updated accounts
document.
Method to query the existence of a document in the
accounts
collection.
This executes a lean mongoose query such that the
properties of the returned document are reduced to
only the "_id"
field.
The query configuration with sort
, order
, pageNumber
, pageSize
.
Whether a document exists which validates the passed query.
Method to query accounts based on query and returns as paginated result.
Find one AccountDocument
instance in the database and use
a query based on the Queryable class.
The query configuration with sort
, order
, pageNumber
, pageSize
.
The resulting accounts
document.
This method creates an accounts
document for the authentication
process. It is used internally to make sure an account always exists
after an authentication challenge was successfully validated on-chain.
Note that this method must be used only when the authentication payload
has been validated and created, i.e. in AuthService.validateChallenge.
The authorized authentication payload.
The corresponding accounts
document.
Method to update a batch of accounts.
This helper method serves as a parser for account
public keys and addresses.
This static method can be used for any inputs that
require to identify a participant [account]. Accounts
can always be referred to by their public key as it can
be used to generate the resulting identifier (address).
Must contain one of an account public key or an account address.
A parsed dHealth Account Address
This public helper generates a random referral code for new
users and can be used when creating new accounts
documents.
Generated using TypeDoc
The main service to handle documents in the
accounts
collection.v0.1.0