Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select option in mongodb #2573

Closed
wujunyucg opened this issue Jul 24, 2018 · 2 comments
Closed

select option in mongodb #2573

wujunyucg opened this issue Jul 24, 2018 · 2 comments

Comments

@wujunyucg
Copy link
Contributor

wujunyucg commented Jul 24, 2018

Issue type:

[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[x] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:
I saw there is select option in repository.find() or repository.findAndCount functions .

/**   

     * Specifies what columns should be retrieved.  

     */   

    select?: (keyof Entity)[];

But it did not work. And in the code , it did not process this option.

const query = this.convertFindManyOptionsOrConditionsToMongodbQuery(optionsOrConditions);  

        const cursor = await this.createEntityCursor(entityClassOrName, query);  

        if (FindOptionsUtils.isFindManyOptions(optionsOrConditions)) {  

            if (optionsOrConditions.skip)  

                cursor.skip(optionsOrConditions.skip);  

            if (optionsOrConditions.take)  

                cursor.limit(optionsOrConditions.take);  

            if (optionsOrConditions.order)  

                cursor.sort(this.convertFindOptionsOrderToOrderCriteria(optionsOrConditions.order));  

        }  

        return cursor.toArray();```
@vlapo
Copy link
Contributor

vlapo commented Jul 24, 2018

Already on roadmap #1929

@wujunyucg
Copy link
Contributor Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants