File tree 1 file changed +10
-3
lines changed
src/services/crud-database
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -284,8 +284,16 @@ const getListOfSharkFollowed = async (userId) => {
284
284
if ( ! ( await checkExistedUserId ( userId ) ) )
285
285
return { message : "user-notfound" } ;
286
286
287
- const users = await InvestorModel . find ( { followers : userId } ) . select (
288
- "sharkId totalAssets percent24h transactionsHistory walletAddress -_id"
287
+ const projection = {
288
+ sharkId : 1 ,
289
+ totalAssets : 1 ,
290
+ percent24h : 1 ,
291
+ walletAddress : 1
292
+ } ;
293
+
294
+ const users = await InvestorModel . find (
295
+ { followers : { $in : [ userId ] } } ,
296
+ projection
289
297
) ;
290
298
291
299
return { message : "success" , datas : users || [ ] } ;
@@ -316,7 +324,6 @@ const getTransactionsOfAllSharks = async (page, valueFilter = 0) => {
316
324
317
325
const transactions = await TransactionModel . aggregate ( [
318
326
{
319
-
320
327
$project : {
321
328
_id : 0 ,
322
329
walletAddress : 1 ,
You can’t perform that action at this time.
0 commit comments