Leo7553799
Posts: 0
Joined: Tue May 26, 2015 5:48 am

While the mapping of a collection is happening, I need to invoke another query to count the number of registers from ano

Hi!

I'd like to list all items from a products_collection and count how many likes an item has. Example bellow.

DATABASE ===============================

*******products_collection
_id
_item
_detail

********users_collection
_id
_name
_email

********like_collection
_id
_products_id (pointer to products)
_users_id (pointer users)

Products Page List =========================

_item
_detail
likes (count like_collection.id where like_collection.products_id = products_collection.id

more specific: while the mapping is happening, I need to invoke another query to count the number of likes of each item has and show in the page.

How can I develop this code?

Return to “Issues”