-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathFirebaseNumberType.json
More file actions
76 lines (76 loc) · 3.46 KB
/
FirebaseNumberType.json
File metadata and controls
76 lines (76 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
"author": "",
"category": "Network",
"extensionNamespace": "",
"fullName": "Firebase",
"gdevelopVersion": "",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZpcmViYXNlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIwLDE4LjY5TDEyLjcsMjIuNzRDMTIuMiwyMyAxMS43LDIzIDExLjIsMjIuNzRMNCwxOC42OUwxNy4wNSw1LjU0TDE3LjQsNS40NEMxNy43LDUuNDQgMTcuODcsNS41NyAxNy45LDUuODRMMjAsMTguNjlNOS4zNSw1Ljc0TDQuOCwxMy4yOUw2LjcsMS4zNEM2LjczLDEuMDcgNi45LDAuOTQgNy4yLDAuOTRDNy40LDAuOTQgNy41MywxIDcuNiwxLjE5TDkuNzUsNS4xNEw5LjM1LDUuNzRNMTMuODUsN0w0LjMsMTYuNTlMMTEuNTUsNC4yOUMxMS42NSw0LjA5IDExLjgsNCAxMiw0QzEyLjIsNCAxMi4zMyw0LjA5IDEyLjQsNC4yOUwxMy44NSw3WiIgLz48L3N2Zz4=",
"name": "FirebaseNumberType",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/ee5e58c7db038efea3f7696e4d3433746814bc34497a148068522da45176c121_firebase.svg",
"shortDescription": "Update a field of a docment with a number type instead of a string.",
"version": "0.1.0",
"description": "This functions exactly the same as the original \"Update a field\" built in function, but this sends a number instead of a string. The built in update function forced you to send strings only which then requires you convert types when you read back from the database. Now you can just send numbers, no conversion needed. ",
"tags": [
"firebase",
"network"
],
"authorIds": [
"3L4MIEb0WdbHratJYzkq1pFqZfw2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Update Firebase Field with Number since the built in function seems to take your number and send it as a string.",
"fullName": "Update a number field of a document",
"functionType": "Action",
"group": "Cloud Firestore Database/Fields",
"name": "FirebaseUpdateNumber",
"sentence": "Update field _PARAM1_ of firestore document _PARAM2_ in collection _PARAM3_ with the number _PARAM4_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const num = eventsFunctionContext.getArgument(\"num\");",
"const db = firebase.firestore();",
"const doc = eventsFunctionContext.getArgument(\"doc\");",
"const col = eventsFunctionContext.getArgument(\"col\");",
"const docRef = db.doc(col+\"/\"+doc);",
"const field = eventsFunctionContext.getArgument(\"field\");",
"docRef.update({[field]: num})"
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Field",
"name": "field",
"type": "string"
},
{
"description": "Document",
"name": "doc",
"type": "string"
},
{
"description": "Collection",
"name": "col",
"type": "string"
},
{
"description": "Number",
"name": "num",
"type": "expression"
}
],
"objectGroups": []
}
],
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
}