我有一个要包含通配符的对象数组。 是否有可能在我的对象的键中实现通配符并允许这种类型的匹配?
dict = [{"foo*" : "A" }, {"bar*" : "B"}]
if (dict["foo_1_2"]){
console.log("FOUND");
}
答案 0 :(得分:1)
一种方法是遍历每个对象的数组获取键并使用regx进行测试
'SELECT "mapping_a"."id", "mapping_a"."prop_a", "mapping_c"."a_ptr_id", "mapping_c"."prop_c" FROM "mapping_c" INNER JOIN "mapping_a" ON ("mapping_c"."a_ptr_id" = "mapping_a"."id") WHERE "mapping_c"."a_ptr_id" = 3'