簡體   English   中英

使用node.js將UUID寫為cassandra中的文本

[英]Write UUID as text in cassandra with node.js

我在cassandra表user_id中有一個列,它是類型文本。 我正在嘗試傳遞生成的uuid,它被打包為要寫入表中的字符串。 當我這樣做時,我收到一個錯誤:

Not a valid text value, expected String obtained uuid

我在傳遞參數時嘗試使用提示:

{hint: 'String', value: data['userId']}

但我仍然得到一個錯誤:

[TypeError: Not a valid text value, expected String obtained { hint: 'String',
  value: 'e738922c-2277-45fd-aa94-7f5e7a189084' }]

我正在使用cassandra版本:2.2.4

知道如何解決這個問題嗎?

我發現了這個問題。 我用的是:

client.execute(query, parameters, {prepare: true}, function(err, result)

當我刪除{prepare:true}時,它開始正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM