class Milvus::Collections

def create(

Returns:
  • (Hash) - Server response

Parameters:
  • fields (Array) -- The fields of the collection.
  • description (String) -- A description of the collection.
  • auto_id (Boolean) -- Whether to automatically generate IDs for the collection.
  • collection_name (String) -- The name of the collection to create.
def create(
  collection_name:,
  auto_id:,
  fields:
)
  response = client.connection.post("#{PATH}/create") do |req|
    req.body = {
      collectionName: collection_name,
      schema: {
        autoId: auto_id,
        fields: fields,
        name: collection_name # This duplicated field is kept for historical reasons.
      }
    }
  end
  response.body.empty? ? true : response.body
end

def describe(collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • collection_name (String) -- The name of the collection to describe.
def describe(collection_name:)
  response = client.connection.post("#{PATH}/describe") do |req|
    req.body = {
      collectionName: collection_name
    }
  end
  response.body
end

def drop(collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • collection_name (String) -- The name of the collection to drop.
def drop(collection_name:)
  response = client.connection.post("#{PATH}/drop") do |req|
    req.body = {
      collectionName: collection_name
    }
  end
  response.body.empty? ? true : response.body
end

def get_load_state(collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • collection_name (String) -- The name of the collection to get the load status of.
def get_load_state(collection_name:)
  response = client.connection.post("#{PATH}/get_load_state") do |req|
    req.body = {
      collectionName: collection_name
    }
  end
  response.body
end

def get_stats(collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • collection_name (String) -- The name of the collection to get the count of.
def get_stats(collection_name:)
  response = client.connection.post("#{PATH}/get_stats") do |req|
    req.body = {
      collectionName: collection_name
    }
  end
  response.body
end

def has(collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • collection_name (String) -- The name of the collection to check.
def has(collection_name:)
  response = client.connection.post("#{PATH}/has") do |req|
    req.body = {
      collectionName: collection_name
    }
  end
  response.body
end

def list

Returns:
  • (Hash) - Server response
def list
  response = client.connection.post("#{PATH}/list") do |req|
    req.body = {}
  end
  response.body
end

def load(collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • collection_name (String) -- The name of the collection to load.
def load(collection_name:)
  response = client.connection.post("#{PATH}/load") do |req|
    req.body = {
      collectionName: collection_name
    }
  end
  response.body.empty? ? true : response.body
end

def release(collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • collection_name (String) -- The name of the collection to release.
def release(collection_name:)
  response = client.connection.post("#{PATH}/release") do |req|
    req.body = {
      collectionName: collection_name
    }
  end
  response.body.empty? ? true : response.body
end

def rename(collection_name:, new_collection_name:)

Returns:
  • (Hash) - Server response

Parameters:
  • new_collection_name (String) -- The new name of the collection.
  • collection_name (String) -- The name of the collection to rename.
def rename(collection_name:, new_collection_name:)
  response = client.connection.post("#{PATH}/rename") do |req|
    req.body = {
      collectionName: collection_name,
      newCollectionName: new_collection_name
    }
  end
  response.body.empty? ? true : response.body
end