I\'m pretty confused with the use of the select
method. This is how I use it, and it\'s wrong:
Transaction.find({username : user.username}).sele
Select method is used to select which fields are to be returned in the query result, excluding select means we want all the fields to be returned, here is simple usage as per the docs.
// include a and b, exclude other fields
query.select('a b');
// exclude c and d, include other fields
query.select('-c -d');
More information here, https://mongoosejs.com/docs/api.html#query_Query-select