小编idk*_*amz的帖子

您如何在 firebase firestore 功能中列出所有用户

我一直在学习 firebase firestore 函数,我想列出所有用户,然后将一个值与他们存储的值进行比较。例如,如果有 20 个用户,我想查看所有名为“mike”的用户,我如何获取用户数组,以便比较它们,以便找到所有名为“mike”的用户?

我在跑步:

"firebase-admin": "^5.11.0",
"firebase-functions": "^1.0.0"
Run Code Online (Sandbox Code Playgroud)

我看到了firebase admin的这段代码,但我不认为它有效,因为它没有被标记为firestore函数,但是如果我返回“admin.auth().listUsers...”,我会得到一个arraylist的用户?

    function listAllUsers(nextPageToken) {
  // List batch of users, 1000 at a time.
  admin.auth().listUsers(1000, nextPageToken)
    .then(function(listUsersResult) {
      listUsersResult.users.forEach(function(userRecord) {
        console.log("user", userRecord.toJSON());
      });
      if (listUsersResult.pageToken) {
        // List next batch of users.
        listAllUsers(listUsersResult.pageToken)
      }
    })
    .catch(function(error) {
      console.log("Error listing users:", error);
    });
}
Run Code Online (Sandbox Code Playgroud)

javascript function firebase google-cloud-functions google-cloud-firestore

6
推荐指数
1
解决办法
5751
查看次数

语法错误,插入"Finally"以完成BlockStatements无法修复

我正在尝试制作加密程序.

如何在第100行摆脱"语法错误,插入"最后"完成BlockStatements"

<imports>

public class Afp {

...

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    ....

    JButton btnEncrypt = new JButton("Encrypt");
    btnEncrypt.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            try{
                String text;
                StringBuffer passWord = new StringBuffer(""+ text);

            for(int i = 0; i < passWord.length(); i++){
                int temp = 0;
                temp = (int)passWord.charAt(i);
                temp = temp*9834 / 8942 /33 *90023243 * 9 +124324534 - 2335 *24324;
                passWord.setCharAt(i, (char)temp);
            }   
            }


        }
    });
    ...
} …
Run Code Online (Sandbox Code Playgroud)

java

-2
推荐指数
2
解决办法
4799
查看次数