Skip to content

AngularFireDatabase doesn't execute functions when an empty list should be returned #1220

@mateusduraes

Description

@mateusduraes

Hello, seems like the AngularFireDatabase is not handling empty lists in the observables.

constructor(private afDb: AngularFireDatabase) {}
// ommited code
public userExists(email: string): Observable<boolean> {
  return this.afDb.list('/clients', ref =>
    ref.orderByChild('email').equalTo(email))
    .valueChanges()
    .map((users: User[]) => users.length > 0);
}

When i call the method with an email that exists in my realtime database, everything is fine, but if the observable should return an empty list, it is not triggered.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions