我正在尝试创建一个应用程序,我可以在特定用户帐户中获取/设置数据,我受到Firebase的诱惑.
我遇到的问题是,当我的结构如下所示时,我不知道如何定位特定用户数据:

online-b-cards
- users
- InnROTBVv6FznK81k3m
- email: "hello@hello"
- main: "Hello world this is a text"
- name: "Alex"
- phone: 12912912
Run Code Online (Sandbox Code Playgroud)
我环顾四周,当他们给出一些随机哈希作为他们的ID时,我真的找不到任何关于如何访问个人数据的信息.
我如何根据他们的名字获取个人用户信息?如果有更好的方法,请告诉我!
我最近在Thinkster上学习了一个使用Angular和Firebase创建Web应用程序的教程.
本教程使用Firebase simpleLogin方法允许创建包含用户名的"配置文件".
厂:
app.factory('Auth', function($firebaseSimpleLogin, $firebase, FIREBASE_URL, $rootScope) {
var ref = new Firebase(FIREBASE_URL);
var auth = $firebaseSimpleLogin(ref);
var Auth = {
register: function(user) {
return auth.$createUser(user.email, user.password);
},
createProfile: function(user) {
var profile = {
username: user.username,
md5_hash: user.md5_hash
};
var profileRef = $firebase(ref.child('profile'));
return profileRef.$set(user.uid, profile);
},
login: function(user) {
return auth.$login('password', user);
},
logout: function() {
auth.$logout();
},
resolveUser: function() {
return auth.$getCurrentUser();
},
signedIn: function() {
return !!Auth.user.provider;
},
user: {} …Run Code Online (Sandbox Code Playgroud)