Skip to main content
Open In ColabOpen on GitHub

动物群

Fauna is a Document Database.

查询 Fauna 个文档

%pip install --upgrade --quiet  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)
API 参考:FaunaLoader

带分页的查询

如果有更多数据,您将获得 after 值。您可以在查询中传入 after 字符串来获取游标之后的值。

要了解更多,请跟随此链接

query = """
Item.paginate("hs+DzoPOg ... aY1hOohozrV7A")
Item.all()
"""
loader = FaunaLoader(query, field, secret)