简体   繁体   English

模式无法使用“找不到字段ID…”异常进行初始化

[英]Schema can't initialize with “Can't find field id …” exception

I need a hand here, it seems I'm getting things wrong. 我在这里需要帮助,看来我弄错了。

I'm constantly getting the following after auth: 认证后,我不断得到以下信息:

java.lang.IllegalStateException: Can't find field id customer.accountId

at org.tarantool.TarantoolConnection16Base.schema(TarantoolConnection16Base.java:214)

I thought ok, may be there is no meta data because there is no data in the space. 我认为好吧,可能没有元数据,因为空间中没有数据。 So I've added a record with all fields, but the error persists. 因此,我添加了包含所有字段的记录,但错误仍然存​​在。

So how is it supposed to work? 那么它应该如何工作? Tarantool records are tuples, where I can store any amount of fields, so I thought fields in the field-mapping are basically an enumeration, where only order counts. Tarantool记录是元组,我可以在其中存储任意数量的字段,因此我认为字段映射中的字段基本上是枚举,其中仅按顺序计数。 Where I'm wrong? 我哪里错了?

Did u forget space.format? 你忘了space.format吗? The example below set that first field has name 'id' and type 'num' and the second field has name 'text' and type 'str' 下面的示例设置第一个字段的名称为“ id”,类型为“ num”,第二个字段的名称为“ text”,类型为“ str”

space = box.schema.space.create('tester')

box.space.tester:create_index('primary', {type = 'hash', parts = {1, 'NUM'}})

box.space.tester:format{{name='id',type='num'},{name='text',type='str'}}    

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM