Users: getUserInfo()
ユーザ情報を取得します。
この関数は非同期関数です。
構文
Users.getUserInfo(userId) => Promise<{ [info: string]: string | number| boolean | null }>
Users.getUserInfo(userId, options) => Promise<{ [info: string]: string | number| boolean | null }>
引数
-
userId
:string
ユーザの識別子です。
-
options
:{ [tableName][, projection] }?
オプション引数です。
-
tableName
:string?
registerTable()
で登録されたテーブル名です。- 既定では最初に登録されたテーブルが使用されます。
-
projection
:{ [key: string]: boolean }?
取得したいユーザ情報を指定するためのマッピングです。
-
返値: Promise<{ [info: string]: string | number| boolean | null }>
ユーザ情報を返すプロミスです。
例外
TypeError
userId
が文字列以外だった場合。options.projection
がオブジェクト以外だった場合。
解説
ユーザ情報は深さ1のオブジェクトです。options.projection
が指定されなければすべてのユーザ情報を取得できます。
options.projection
が指定された場合、値が true
となるキーと同名のキーのユーザ情報のみ取得できます。