http://krajiyah.github.io/firebase-admin-util
- schema must be in following format:
{
"User": {
"path": "Users",
"fields": {
"name": "string",
"image": "link",
"age": "number",
"isAdmin": "boolean",
"meta": "object",
"dogs": "array:Dogs",
"cat": "string:Cats"
}
},
"Dog": {
"path": "SomeNode/SomeNode/Dogs",
"fields": {
"name": "string",
"user": "string:Users"
}
},
"Cat": {
"path": "SomeNode/Cats",
"fields": {
"name": "string",
"user": "string:Users"
}
}
}
- Example usage:
const User = require("firebase-admin-util")(firebase, schema).db.User;
User.getByKey("some key").then(function(user) {
// do stuff with User object fetched
});