milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
351 stars 110 forks source link

[Bug]: How to iterate through custom field #826

Closed Erodotos closed 2 months ago

Erodotos commented 2 months ago

Is there an existing issue for this?

Current Behavior

How to get the values of a field and iterate through it?

I have this code which is wrong and not working.

animals, _ := result[0].Fields.GetColumn("animals")

Went trough the documentation but did not find anything. Any kind of guidance would be appreciated.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

RomitSingh1999 commented 2 months ago

@Erodotos What is the error you are getting?

Erodotos commented 2 months ago

@Erodotos What is the error you are getting?

I dont get an error.

I am just trying to extract the column values in an array or slice but I can not find if there is a way to do this.

The returned struct is of entity.Column type, which is an interface.

Erodotos commented 2 months ago

Issue resolved. Found how to iterate result after looking at the example here

Answer on lines 120 - 141