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 attributes in Find method - mongodb #1929

Closed
thonythony opened this issue Apr 13, 2018 · 2 comments
Closed

Select attributes in Find method - mongodb #1929

thonythony opened this issue Apr 13, 2018 · 2 comments

Comments

@thonythony
Copy link
Contributor

Issue type:

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

Database system/driver:

[ ] cordova
[x] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] websql

TypeORM version:

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

Steps to reproduce or a small repository showing the problem:

According to documentation located in http://typeorm.io/#/find-options, I want to select specific attributes from my find query. I am using MongoDB and this doesn't work.
Can you explain me please ?

Thanks

@pleerock
Copy link
Member

Some of find options are rdbms specific, can you please provide a code snippet of what you are executing, expected results what you get?

@thonythony
Copy link
Contributor Author

thonythony commented Apr 16, 2018

I have an entity with three fields :

  • name
  • value
  • createdAt

I execute this kind of code :

settingRepository.find({ select: ["name"] });

I expected a list of object composed with only field "name" (so without "value" and "createdAt").
I got a list of object composed with all fields ("name, "value", "createdAt", "id").

I looked up very quickly typeorm code and I don't see an implementation of this feature. I looked up very quickly mongodb driver javascript code and I don't see an implementation of select feature.
I came from mongoose, and now I am thinking this feature is implemented only by mongoose...

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

No branches or pull requests

2 participants