I want to add a new user to firebase database with auto increment id as shown below screenshots:

[![enter image description here](https://i.stack.imgur.com/LvgZd.png)](https://i.stack.imgur.com/LvgZd.png)

I have tried:

```
    var rootRef = firebase.database().ref();
    var storesRef = rootRef.child("/users");
    storesRef.set({
      "name": "user1",
      "pageId": "user1"
    });

```