Skip to content

Can't insert #124

Open
Open
@LestatDelionkur

Description

@LestatDelionkur

I'm insert tuple with the following code
var result= await _primaryIndex.Insert<TarantoolTuple<T>>(TarantoolTuple.Create(entity));
and get an exception "Тarantool returns an error for request with id: 87, code: 0x00008027 and message: Tuple field count 1 is less than required by a defined index (expected 2)."
This is my entity code:

    [MsgPackArray]
    public class UnitType
    {
        [MsgPackArrayElement(0)]
        public ulong Id { get; set; }
        [MsgPackArrayElement(1)]
        public string Name { get; set; }
    }

  --Space definition
    unit_type=box.schema.space.create('unit_type',{format={
        [1]={["name"]="id",["type"]="unsigned"},
        [2]={["name"]="name",["type"]="string"}
    },if_not_exists = true})
    unit_type_id_seq=box.schema.sequence.create('unit_type_id_seq');

    unit_type:create_index('primary',{
        if_not_exists=true,
        type='TREE',
        unique=true,
        parts={1,'UNSIGNED'}
        ,sequence='unit_type_id_seq'
    })

Can you help me with insert and update operations? I can't find guide for this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions