Argument of type \'{ query: { limitTolast: number; orderByKey: boolean; }; }\' is not assignable to parameter of type \'QueryFn\'.Object literal may only specify known propertie
QueryFn must return a firebase.database.Query, not void. You can code the query like this one, for more clear:
getMessages(): Observable { return this.db.list('/messages', ref => { let q = ref.limitTolast(25).orderByKey(true); return q; }); }