We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46c8787 commit d9ebd04Copy full SHA for d9ebd04
child-count/functions/index.js
@@ -39,7 +39,7 @@ exports.recountlikes = functions.database.ref("/posts/{postid}/likes_count").onW
39
if (!event.data.exists()) {
40
var counterRef = event.data.ref;
41
var collectionRef = counterRef.parent.child('likes');
42
- return collectionRef.once('value', function(messagesData) {
+ return collectionRef.once('value').then(function(messagesData) {
43
return counterRef.set(messagesData.numChildren());
44
});
45
}
0 commit comments