Skip to content

Commit e651200

Browse files
committed
One more database snippet
1 parent 3138158 commit e651200

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

database/lists-of-data.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ function socialListenValue() {
5252
// [END rtdb_social_listen_value]
5353
}
5454

55+
function socialMostStarred() {
56+
// [START rtdb_social_most_starred]
57+
var myUserId = firebase.auth().currentUser.uid;
58+
var topUserPostsRef = firebase.database().ref('user-posts/' + myUserId).orderByChild('starCount');
59+
// [END rtdb_social_most_starred]
60+
}
61+
5562
function socialMostViewed() {
5663
// [START rtdb_social_most_viewed]
5764
var mostViewedPosts = firebase.database().ref('posts').orderByChild('metrics/views');

0 commit comments

Comments
 (0)