From 4958723a42f13f2a162d76bde456db87e1506428 Mon Sep 17 00:00:00 2001 From: shobhitm23 Date: Fri, 8 Nov 2019 18:08:28 -0500 Subject: [PATCH] Filtering just with topics --- functions/handlers/post.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functions/handlers/post.js b/functions/handlers/post.js index a57cfe1..b41a470 100644 --- a/functions/handlers/post.js +++ b/functions/handlers/post.js @@ -69,3 +69,13 @@ exports.getallPosts = (req, res) => { exports.getFilteredPosts = (req, res) => { admin.firestore().collection('posts').where('userHandle', '==', 'new user').where('microBlogTopics', '==') }; + +exports.getFilteredPostsOnTopics = (req, res) => { + + // get topics that user follows + // make a set storing all topics + // for each post, make a set of topics and if A and B != 0, you can display post + var topics = admin.firestore().collection('users').where('userHandle', '==', req.userHandle) + var query = admin.firestore().collection('posts'); + +} \ No newline at end of file