Main entry point for firebase-admin-util
(require("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"
}
}
};