var ref = new Firebase("https://dinosaur-facts.firebaseio.com/");
ref.orderByChild("height").on("child_added", function(snapshot) {
console.log(snapshot.key() + " was " + snapshot.val().height + " meters tall");
});
var ref = new Firebase("https://dinosaur-facts.firebaseio.com/");
ref.orderByChild("height").startAt(3).on("child_added", function(snapshot) {
console.log(snapshot.key())
});
Hey Chuck, the fb element is very basic and doesn't support a lot of firebase's awesome. PRs or new elements to that repo are welcome :)
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/7a560412-09a6-4957-930c-5a95ae9cf2b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<firebase-element id="dinosaurOrderByChild" on-data-change="{{dinosaurOrderByChildDataChange}}" data="{{dinosaurOrderByChildData}}" keys="{{dinosaurOrderByChildKeys}}" orderByChild="order" location="https://dinosaur-facts.firebaseio.com/" log></firebase-element>
requery: function() {
// shut-down previous observers (if any)
this.closeQuery();
this.closeObserver();
// construct new query
var query = this.ref;
if (query) {
if (this.start && !this.orderByKey) {
console.log("requery: startAt", this.start);
query = query.startAt(this.start);
}
if (this.end) {
query = query.endAt(this.end);
}
if (this.limit > 0) {
query = query.limit(this.limit);
}
if (this.limitToFirst > 0) {
query = query.limitToFirst(this.limitToFirst);
}
if (this.limitToLast > 0) {
query = query.limitToLast(this.limitToLast);
}
if (this.orderByChild) {
console.log("requery: orderByChild", this.orderByChild, this.ref);
query = query.orderByChild(this.orderByChild);
}
if (this.orderByKey) {
if (this.start) {
query = query.orderByKey().startAt(this.start);
} else {
query = query.orderByKey();
}
// console.log("requery: orderByKey", query);
}
if (this.orderByPriority) {
console.log("requery: orderByPriority", this.ref);
query = query.orderByPriority();
}
this.query = query;
// console.log("requery: query", this.query)
}
},