public long getUserPhotoCount(String userId) {
        long result = 0L;
        DBCursor cursor = database.getCollection(ACTIVITY_COLLECTION).find(new BasicDBObject("_id", Pattern.compile("^" + userId)), new BasicDBObject("photos", 1));
        try {
            while (cursor.hasNext()) {
                DBObject activity = cursor.next();
                if (activity.get("photos") != null) {
                    result += ((BasicDBList) activity.get("photos")).size();

                }
            }
        } finally {
            cursor.close();
        }

        return result;
    }