Getting cards by purchases from PostgreSQL rather than from MongoDB