1db.collection("users") returns an object of CollectionReference. CollectionReference has no function 'set', Hence the error. Perhaps you are looking for the function 'add' which adds documents.
2
3Replace
4
5 db.collection("users").set({
6 points: 0,
7 CurrentLevel: 0
8 })
9with
10
11 db.collection("users").add({
12 points: 0,
13 CurrentLevel: 0
14 })
15And I think that should solve your problem