运行“复杂”使用 amazon SDB (simpledb) 进行查询 - aws-sdb +活动资源
鉴于 simpledb 是一个非常简单的数据存储这一事实,我正在考虑以下“复杂”查询:我正在尝试使用 OR 查询来查询 aws-sdb 域。使用 ruby、rails (2) 和 ActiveResource。我正在使用 http://developer.amazonwebservices.com/connect 中的代码示例/entry.jspa?externalID=1242 (不显示或顺便查询)
class Team < ActiveResource::Base
self.site = "http://localhost:8888" # Proxy host + port
self.prefix = "/foo_dev/" # SDB domain
end
选择代码(不起作用):
Team.find(:all, :from => :query, :params => "['player1' = 100001160313805 or 'player2' = 100001160313806]")
选择代码(起作用,但没有 OR):
Team.find(:all, :from => :query, :params => "['player1' = 100001160313805]")
我非常感谢任何见解,因为我已经为此苦苦挣扎了几个小时。 预先非常感谢所有评论。
I am considering the following a "complex" query, given the fact that simpledb is a really simple data storage: I am trying to query a aws-sdb domain with an OR query. using ruby, rails (2) and ActiveResource. I am using the code examples from http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1242 (which don't show Or queries by the way)
class Team < ActiveResource::Base
self.site = "http://localhost:8888" # Proxy host + port
self.prefix = "/foo_dev/" # SDB domain
end
select code (not working):
Team.find(:all, :from => :query, :params => "['player1' = 100001160313805 or 'player2' = 100001160313806]")
select code (working, but no OR):
Team.find(:all, :from => :query, :params => "['player1' = 100001160313805]")
i am very thankful for any insights, since i am struggling with this for a few hours now.
thanks a lot in advance for all comments.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试 http://github.com/appoxy/simple_record 上的 SimpleRecord 使用 SimpleDB 作为数据库。您的查询应该进行一些调整,例如交换引号,例如:
Team.find(:all, :conditions => "[player1 = '100001160313805']")
Try SimpleRecord at http://github.com/appoxy/simple_record to use SimpleDB as the database. You're queries should work with a little tweaking like swapping the quotes around, eg:
Team.find(:all, :conditions => "[player1 = '100001160313805']")