public void insertCommentDependencies(BasicDBList comments) {
        Map<String, List<DBObject>> map = new HashMap<String, List<DBObject>>();
        BasicDBList photoIds = new BasicDBList();

        for (Object objectComment : comments) {
            DBObject comment = (DBObject) objectComment;
            String photoId = (String) comment.get("itemId");

            photoIds.add(photoId);
            if (!map.containsKey(photoId)) {
                map.put(photoId, new ArrayList<DBObject>());
            }
            map.get(photoId).add(comment);
        }

        BasicDBList photos = readPhotos(photoIds);
        for (Object objectPhoto : photos) {
            DBObject photo = (DBObject) objectPhoto;
            String idPhoto = (String) photo.get("_id");
            for (DBObject comment : map.get(idPhoto)) {
                comment.put("photo", photo);
            }
        }
    }