Skip to content

Commit edefe05

Browse files
committed
fix: further implementation in mongo DB client
1 parent 7f79258 commit edefe05

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/db/mongo/repo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const collectionName = 'repos';
77

88
export 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();

src/db/mongo/users.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)