A
A
asilent2020-02-23 14:22:09
Counts
asilent, 2020-02-23 14:22:09

How to create a face like?

Hey!

Situation:
There is a user, there is a post that the user can create, and there are comments that the post can have. it turns out 3 collections: users, posts, comments

Question:
how to organize likes?

Assumption (2 options that I see):
1. Perhaps you need to create 1 collection of faces (likes) and associate with documents:
like user:
{ _from: 'user/123', _to: 'user/456' }
like post:
{ _from: 'user/123', _to: 'post/789' }
like comment:
{ _from: 'user/123', _to: 'comment/654' }

2. Create a collection of faces for each entity (userlikes, postlikes, commentlikes

) how to do it correctly in order to speed up the calculation as much as possible:
a) how many likes the post has and who put them
b) to whom / what the user liked

I'm just starting to understand arangodb, so don't scold me for stupid questions. I read the Doc, but there are so many options and which one would be best is hard to understand.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question