的AWS SimpleDB documentation为Ruby SDK提供下面的例子是关于使用get_attributes
方法:如何检测SimpleDB域是否包含请求的项目?
resp = client.get_attributes({
domain_name: "String", # required
item_name: "String", # required
attribute_names: ["String"],
consistent_read: false,
})
...,然后将下面的示例响应:
resp.attributes #=> Array
resp.attributes[0].name #=> String
resp.attributes[0].alternate_name_encoding #=> String
resp.attributes[0].value #=> String
resp.attributes[0].alternate_value_encoding #=> String
它还指出以下的一段建议:
如果在该操作所访问的副本上不存在该项目,则会返回一个空集斯内德。系统不会返回错误,因为它无法保证该项目不存在于其他副本上。
我希望我误解这一点,但如果你的反应不会返回一个空集,那么怎么是你应该知道,如果是因为没有项目与所提供的项名称存在,或者如果您的要求只是打一个不包含你的物品的复制品?