@Override
    protected List<Object> getIds(Class<?> targetType, Predicate condition) {
        MongoCollection<Document> collection = getCollection(targetType);
        // TODO : fetch only ids
        FindIterable<Document> cursor = createCursor(collection, condition, null,
                QueryModifiers.EMPTY, Collections.<OrderSpecifier<?>>emptyList());

        MongoCursor<Document> iterator = cursor.iterator();
        try {

            if (iterator.hasNext()) {
                List<Object> ids = new ArrayList<Object>();
                for (Document obj : cursor) {
                    ids.add(obj.get("_id"));
                }
                return ids;
            } else {
                return Collections.emptyList();
            }
        } finally {
           iterator.close();
        }
    }
Fetch results with the specific fields

@param paths fields to return
@return results
querydsl-mongodb/src/main/java/com/querydsl/mongodb/document/AbstractFetchableMongodbQuery.java