查看 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)