SimpleMongoReader
定义于:.build/typescript/packages/providers/storage/mongodb/src/readers/mongo.ts:8
从MongoDB读取
BaseReader<Document>
new SimpleMongoReader(
client):SimpleMongoReader
定义于:.build/typescript/packages/providers/storage/mongodb/src/readers/mongo.ts:11
MongoClient
SimpleMongoReader
loadData()
Section titled “loadData()”loadData<
TSchema>(dbName,collectionName,fieldNames,separator,filterQuery,maxDocs,metadataNames?):Promise<Document<Metadata>[]>
定义于:.build/typescript/packages/providers/storage/mongodb/src/readers/mongo.ts:40
从MongoDB集合加载数据
TSchema
Section titled “TSchema”TSchema extends Document = Document
dbName
Section titled “dbName”string
要加载的数据库名称。
collectionName
Section titled “collectionName”string
要加载的集合名称。
fieldNames
Section titled “fieldNames”string[] = ...
从每个文档中检索的字段名称数组。默认为 [“text”]。
string = ""
用于连接多个字段值的分隔符。默认为空字符串。
filterQuery
Section titled “filterQuery”Filter<TSchema> = {}
具体查询,按照 MongoDB NodeJS 文档中的规定。
maxDocs
Section titled “maxDocs”number = 0
要检索的最大文档数量。默认为0(检索所有文档)。
string[]
一个可选的元数据字段名称数组。如果指定,则将此信息提取为元数据。
Promise<Document<Metadata>[]>
如果在MongoDB文档中未找到fieldNames或metadataNames中指定的字段。
BaseReader.loadData