检视 Collection
Collection 加载完成后,你可以检查其结构、配置及运行时状态,以更好地了解它的组织方式和运行情况。这在开发、调试或监控系统时尤为有用。
快速参考
| 属性 | 说明 |
|---|---|
Collection.schema | Collection 的结构和字段 (如向量维度、数据类型) |
Collection.stats | 运行时指标,如 document 数量和索引构建进度 |
Collection.option | 运行时配置 (如只读模式、内存映射) |
Collection.path | Collection 目录的具体路径 |
Collection Schema
查看 Schema:
print(collection.schema)查看标量字段:
print(collection.schema.fields)查看向量字段:
print(collection.schema.vectors)Collection 统计信息
stats 属性提供实时运行状态:
print(collection.stats)Collection 选项
加载 collection 时传入的选项决定了其运行时行为:
print(collection.option)Collection 路径
path 属性返回 collection 在磁盘上的位置:
print(collection.path)