File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const collectionName = 'repos';
77
88export const getRepos = async ( query : any = { } ) : Promise < Repo [ ] > => {
99 const collection = await connect ( collectionName ) ;
10- const docs = collection . find ( query ) . toArray ( ) ;
10+ const docs = await collection . find ( query ) . toArray ( ) ;
1111 return _ . chain ( docs )
1212 . map ( ( x ) => toClass ( x , Repo . prototype ) )
1313 . value ( ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export const getUsers = async function (query: any = {}): Promise<User[]> {
3232 }
3333 console . log ( `Getting users for query = ${ JSON . stringify ( query ) } ` ) ;
3434 const collection = await connect ( collectionName ) ;
35- const docs = collection . find ( query ) . project ( { password : 0 } ) . toArray ( ) ;
35+ const docs = await collection . find ( query ) . project ( { password : 0 } ) . toArray ( ) ;
3636 return _ . chain ( docs )
3737 . map ( ( x ) => toClass ( x , User . prototype ) )
3838 . value ( ) ;
You can’t perform that action at this time.
0 commit comments