Use MongoDB aggregate to get resources list

This avoids querying two different collections to get the data, doing
aggregation on one is enough.

Change-Id: Ia21693051daefd1ebd4d0c7d07b76d4712b0542c