Skip to content
Snippets Groups Projects
Commit 6032cbcf authored by Elliot Kang's avatar Elliot Kang Committed by Yi Ding
Browse files

Fixed typing to be more restrictive

- Should have done this in the beginning, {Key:Value} objects should always be defined by Record<string, any>
parent 73785d75
No related branches found
No related tags found
No related merge requests found
......@@ -17,9 +17,9 @@ export class SimpleMongoReader implements BaseReader {
* @param {string} db_name - The name of the database to load.
* @param {string} collection_name - The name of the collection to load.
* @param {Number} [max_docs = 0] - Maximum number of documents to return. 0 means no limit.
* @param {object} [query_dict={}] - Specific query, as specified by MongoDB NodeJS documentation.
* @param {object} [query_options={}] - Specific query options, as specified by MongoDB NodeJS documentation.
* @param {projection} [projection = {}] - Projection options, as specified by MongoDB NodeJS documentation.
* @param {Record<string, any>} [query_dict={}] - Specific query, as specified by MongoDB NodeJS documentation.
* @param {Record<string, any>} [query_options={}] - Specific query options, as specified by MongoDB NodeJS documentation.
* @param {Record<string, any>} [projection = {}] - Projection options, as specified by MongoDB NodeJS documentation.
* @returns {Promise<Document[]>}
*/
async loadData(
......@@ -27,9 +27,9 @@ export class SimpleMongoReader implements BaseReader {
collection_name: string,
max_docs = 0,
//For later: Think about whether we want to pass generic objects in...
query_dict = {},
query_options = {},
projection = {},
query_dict: Record<string, any> = {},
query_options: Record<string, any> = {},
projection: Record<string, any> = {},
): Promise<Document[]> {
//Get items from collection using built-in functions
const cursor: Partial<Document>[] = await this.client
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment