_Ali94
July 19, 2017, 2:55pm
1
hello guys
How can I get the data of last 10 elements of firebase
or how can I get the items of last 2 weeks from today
I’m using this code to get all data,
this.itemList = this.afd.list('/items/')
but i don’t know how it work with dates or limit number of items
const queryObservable = db.list('/items', {
query: {
orderByChild: 'size',
equalTo: 'large'
}
});
to oder by date use orderByKey
here is the documentation
https://github.com/angular/angularfire2/blob/master/docs/4-querying-lists.md
1 Like
_Ali94
July 20, 2017, 2:11am
3
Thank u very much
But what about if I want to get items of last 2 weeks from today ?
For this problem, I couldn’t find the solution until now
_Ali94
July 20, 2017, 12:12pm
4
Is there any solution for this point ?
have you taken a look at this?
javascript, firebase
1 Like
DMoney
May 13, 2018, 11:50pm
6
What if those items were created with a unique auto generated ID by firebase? So it would be items/UUID/item.property. How would you query those items?