import type { MongoClient } from "mongodb"; import { Document } from "../Node.js"; import type { BaseReader } from "./type.js"; /** * Read in from MongoDB */ export declare class SimpleMongoReader implements BaseReader { private client; constructor(client: MongoClient); /** * Flattens an array of strings or string arrays into a single-dimensional array of strings. * @param texts - The array of strings or string arrays to flatten. * @returns The flattened array of strings. */ private flatten; /** * Loads data from MongoDB collection * @param {string} dbName - The name of the database to load. * @param {string} collectionName - The name of the collection to load. * @param {string[]} fieldNames - An array of field names to retrieve from each document. Defaults to ["text"]. * @param {string} separator - The separator to join multiple field values. Defaults to an empty string. * @param {Record} filterQuery - Specific query, as specified by MongoDB NodeJS documentation. * @param {Number} maxDocs - The maximum number of documents to retrieve. Defaults to 0 (retrieve all documents). * @param {string[]} metadataNames - An optional array of metadata field names. If specified extracts this information as metadata. * @returns {Promise} * @throws If a field specified in fieldNames or metadataNames is not found in a MongoDB document. */ loadData(dbName: string, collectionName: string, fieldNames?: string[], separator?: string, filterQuery?: Record, maxDocs?: number, metadataNames?: string[]): Promise; }