Hi,
I'm not really confortable with the double dot, but I have no other idea
for the moment :) (maybe '->' ?).
And should your pseudo code not be written this way :
var filtered = filter({
"x.sites.'google.com'.type": {
data: "search engine"
}
});
?
Seb
On Thu, Dec 13, 2012 at 5:22 PM, Kris Borchers <kris(a)redhat.com> wrote:
Hey all, I am trying to enhance the filter method to be able to
filter
objects based on values nested inside other objects inside that main
object. My first thought was just to use dot notation to specify the field
we are filtering on but that runs into issues if the key actually has a "."
in it like this:
var x = {
sites: {
"google.com": {
type: "search engine"
}
}
}
Trying to traverse that object via:
// pseudocode
var filtered = filter({
"x.sites.google.com.type": {
data: "search engine"
}
});
would fail. I'm wondering if we should just define our own separator for
the path through the object. We could use ".." (double-dot) which I think
should work so something like:
// pseudocode
var filtered = filter({
"x..sites..google.com..type": {
data: "search engine"
}
});
Then I can separate on ".." and parse that way. Thoughts?
_______________________________________________
aerogear-dev mailing list
aerogear-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev