0

I'm trying to order an acccount list using orderByChild using dateCreated field, but the return list(response) is not sorted by dateCreated

 this.angularDb.list('accounts', ref => ref
        .orderByChild('dateCreated').startAt(0).limitToFirst(10)
        ).valueChanges()
        .subscribe(response => {
            for (let item of response) {
              this.tableData.push(item);
            }
     
         }, error => {
            console.log(error);
         });
    
  }

Any idea what I'm doing wrong? I cannot find any source solve this issue

Tomislav Stankovic
  • 3,080
  • 17
  • 35
  • 42
Cassini
  • 119
  • 1
  • 13

1 Answers1

0

I found the answer which is that firebase does not support sorting dates: https://firebase.google.com/docs/database/web/lists-of-data#data-order

Cassini
  • 119
  • 1
  • 13