在Json数据上发现重复的查询 - postgress

时间:2015-12-16 12:02:56

标签: ruby-on-rails json postgresql

在运行我提供的数据查询时出现问题, 如果我Camera.first得到结果

#<Camera id: 6, created_at: "2013-12-12 17:30:32", updated_at: "2015-11-19 10:19:33", exid: "dublin-rememberance-floor2", owner_id: 4, is_public: true, config: {"snapshots"=>{"jpg"=>"/onvif/snapshot"}, "external_http_port"=>8105, "external_host"=>"89.101.225.158", "auth"=>{"basic"=>{"username"=>"admin", "password"=>"mehcam"}}}, name: "My Camera", last_polled_at: "2015-11-27 15:01:51", is_online: false, timezone: nil, last_online_at: "2014-05-01 09:45:39", location: "0101000020E6100000875341A08E0A19C0D6BB896BC6AC4A40", mac_address: nil, model_id: 6, discoverable: false, preview: nil, thumbnail_url: nil>

我完全不知道如何让查询运行CONFIG对象。 示例:我想选择所有具有相同

的Cameras列表
"external_http_port"=>8105, "external_host"=>"89.101.225.158"

但它们位于Config Object中。

1 个答案:

答案 0 :(得分:0)

您可以为json数据提取编写如下查询:

$('#map').locationpicker("location", {latitude: 55.859028119431926, longitude: -4.234895706176758});