Schema

CollectionSchema and FieldSchema.

Constructor

Constructor

Description

CollectionSchema()

Schema of collection.

FieldSchema()

Schema of field.

CollectionSchema Attributes

API

Description

fields

Return the fields of collection.

description

Return the description text about the collection.

primary_field()

Return the primary key column of collection.

auto_id()

Return whether the ids is automatically generated.

APIs

class pymilvus_orm.CollectionSchema(fields, description='', **kwargs)
property fields

Return the fields about the CollectionSchema.

Return list

List of FieldSchema, return when operation is successful.

Example

>>> from pymilvus_orm.schema import FieldSchema, CollectionSchema
>>> from pymilvus_orm.types import DataType
>>> from pymilvus_orm import connections
>>> connections.create_connection(alias="default")
<milvus.client.stub.Milvus object at 0x7f9a190ca898>
>>> field = FieldSchema("int64", DataType.INT64, descrition="int64", is_parimary=False)
>>> schema = CollectionSchema(fields=[field])
>>> schema.fields
property description

Return the description text about the CollectionSchema.

Return str

CollectionSchema description text, return when operation is successful.

Example

>>> from pymilvus_orm.schema import FieldSchema, CollectionSchema
>>> from pymilvus_orm.types import DataType
>>> from pymilvus_orm import connections
>>> connections.create_connection(alias="default")
<milvus.client.stub.Milvus object at 0x7f9a190ca898>
>>> field = FieldSchema("int64", DataType.INT64, descrition="int64", is_parimary=False)
>>> schema = CollectionSchema(fields=[field], description="test get description")
>>> schema.description
property auto_id

Whether primary keys are automatically generated.

Return bool

Return true if primary keys are automatically generated, false otherwise.

Example

>>> from pymilvus_orm.schema import FieldSchema, CollectionSchema
>>> from pymilvus_orm.types import DataType
>>> from pymilvus_orm import connections
>>> connections.create_connection(alias="default")
<milvus.client.stub.Milvus object at 0x7f9a190ca898>
>>> field = FieldSchema("int64", DataType.INT64, descrition="int64", is_parimary=False)
>>> schema = CollectionSchema(fields=[field])
>>> schema.auto_id

FieldSchema Attributes

API

Description

name

Return the name of field.

is_primary

Return whether the field is primary key column.

APIs

class pymilvus_orm.FieldSchema(name, dtype, description='', **kwargs)