Methods
module:index(firebase, schema)
Firebase Admin Util
Parameters:
Name | Type | Description |
---|---|---|
firebase |
object | Firebase Admin SDK instance |
schema |
object | Database schema for object mapping |
Examples
// Example schema (showing usage of all types)
let schema = {
"User": {
"path": "Users",
"fields": {
"name": "string",
"image": "link",
"age": "number",
"isAdmin": "boolean",
"meta": "object",
"dogs": "array:Dogs", // array of keys to Dog objects
"cat": "string:Cats" // key to Cat object
}
}
};
// Example schema (showing nested nodes as path)
let schema = {
"Dog": {
"path": "SomeNode/SomeNode/Dogs",
"fields": {
"name": "string",
"user": "string:Users"
}
},
"Cat": {
"path": "SomeNode/Cats",
"fields": {
"name": "string",
"user": "string:Users"
}
}
};
Type Definitions
JSON
JSON representation of FirebaseObject
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
key |
string | The key of the object |
value |
object | The value of the object |
- Source: