pub fn get_ref(
db: &Database,
path: String,
) -> Result<DatabaseReference, FirebaseError>
Expand description
Takes a [FirebaseDatabase] instance and a [path] and returns a [FirebaseDbReference] instance. Fails only if underlying JS function fails.
You can think of the returne [FirebaseDbReference] as a pointer into a specific part of your database, which you can use in conjunction with other functions to read and write data.
ยงExamples
use firebase_js_sys::{app::initialize_app, database::{get_database, get_ref}};
let app = initialize_app(config); // config is a FirebaseConfig instance
let db = get_database(&app, "https://my-project.firebaseio.com");
let db_ref = get_ref(&db, "users/1234");
let db_ref2 = get_ref(&db, "users/1234/name");