首页 文章

在Google Cloud数据存储区中查询

提问于
浏览
1

我在Cloud数据存储区中有我的实体 . 其中一个属性是Localities,它是串联的字符串,例如 . 洛杉矶;旧金山;拉斯维加斯 . 现在我如何获得以下类似查询将给出的数据:

从CloudEntity中选择*,其中“%San Francisco%”等地区

1 回答

  • 4

    而不是存储单个字符串,存储字符串列表 . 然后使用相等过滤器 . 在json中它将是:

    Localities:  {listValue: [
        {stringValue: "Los Angeles"}, 
        {stringValue: "San Francisco"}, 
        {stringValue: "Las Vegas"}]}
    

    然后:

    Select * from CloudEntity where Localities = "San Francisco"
    

相关问题