Users class
Used to create, upsert, query, and read all users.
See User to read, replace, or delete a specific User by id.
Properties
database |
Methods
create(User |
Create a database user with the specified UserDefinition. |
query(Sql |
Query all users. |
query<T>(Sql |
Query all users. |
read |
Read all users.- Example Read all users to array.
|
upsert(User |
Upsert a database user with a specified UserDefinition. |
Property Details
database
Method Details
create(UserDefinition, RequestOptions)
Create a database user with the specified UserDefinition.
function create(body: UserDefinition, options?: RequestOptions): Promise<UserResponse>
Parameters
- body
- UserDefinition
The specified UserDefinition.
- options
- RequestOptions
Returns
Promise<UserResponse>
query(SqlQuerySpec, FeedOptions)
Query all users.
function query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>
Parameters
- query
- SqlQuerySpec
Query configuration for the operation. See SqlQuerySpec for more info on how to configure a query.
- options
- FeedOptions
Returns
QueryIterator<any>
query<T>(SqlQuerySpec, FeedOptions)
Query all users.
function query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>
Parameters
- query
- SqlQuerySpec
Query configuration for the operation. See SqlQuerySpec for more info on how to configure a query.
- options
- FeedOptions
Returns
readAll(FeedOptions)
Read all users.-
Example
Read all users to array.
const {body: usersList} = await database.users.readAll().fetchAll();
function readAll(options?: FeedOptions): QueryIterator<UserDefinition & Resource>
Parameters
- options
- FeedOptions
Returns
upsert(UserDefinition, RequestOptions)
Upsert a database user with a specified UserDefinition.
function upsert(body: UserDefinition, options?: RequestOptions): Promise<UserResponse>
Parameters
- body
- UserDefinition
The specified UserDefinition.
- options
- RequestOptions
Returns
Promise<UserResponse>