Zio.mongo()
Read‑only.
It is a place for viewing collected data, so writing is not possible — if you look at other sets and infer from Zio.mongo(...).create(...), there is none of that. To compare it with the network, see the table in Zio.Database (Overview).
MongoDB 조회
You can easily query data from dynamically created user‑defined collections in a MongoDB database and receive it as a GraphResult object.
| Method | Description |
|---|---|
Zio.mongo(collection_name) |
Retrieves data from a user‑defined collection created in MongoDB and returns it in the form of a GraphResult. |
MongoDB 데이터 조회 예제 (main.py)
Section titled “MongoDB 데이터 조회 예제 (main.py)”from zio_ontology import Ziofrom fastapi import FastAPIfrom fastapi.responses import JSONResponse
app = FastAPI()
@app.get("/api/mongo/{collection}")async def run_mongo(collection: str): result = Zio.mongo(collection) return JSONResponse(content={"data": result.data})When calling a non‑existent collection
Section titled “When calling a non‑existent collection”A
LookupErroroccurs — it says “there is no data” is not the case; rather “that collection does not exist.” If you conflate the two, a typo in the name reads as an “empty result,” so the caller keeps trying by slightly changing the name. Collections are created by the data collection pipeline — they cannot be made here.Therefore do not guess the name; first call
Zio.mongo.list(). It returns[ {name, description, columns[]} ]— only readable ones appear, so a missing name will also result in aLookupErrorfromZio.mongo().
(주)지오유 · 경기 용인시 처인구 유림로154번길(유방동 673-2) 20-13
CEO 신달수·Business no. 142-81-36612·E-commerce no. 용인처인-0118호·Privacy officer 신달수·Email shindalsoo@gmail.com·Tel 1833-3623·Fax 02-6918-4006