跳到主要内容
Fauna 是一个文档数据库。
查询 Fauna 文档
pip install -qU  fauna

查询数据示例

from langchain_community.document_loaders.fauna import FaunaLoader

secret = "<enter-valid-fauna-secret>"
query = "Item.all()"  # Fauna query. Assumes that the collection is called "Item"
field = "text"  # The field that contains the page content. Assumes that the field is called "text"

loader = FaunaLoader(query, field, secret)
docs = loader.lazy_load()

for value in docs:
    print(value)

带分页的查询

如果还有更多数据,您会得到一个 after 值。您可以通过在查询中传入 after 字符串来获取光标之后的值。 要了解更多信息,请点击此链接
query = """
Item.paginate("hs+DzoPOg ... aY1hOohozrV7A")
Item.all()
"""
loader = FaunaLoader(query, field, secret)

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.