0

I am practicing firebase Real time Database but looking the query Structure I am planning to use the QueryBase https://github.com/davideast/Querybase

so I was just wandering how to deal with it?

I have a service called UserService

export class UsersService {
  private dbPath = '/users';

  usersRef: AngularFireList<User> = null;

 constructor( private db: AngularFireDatabase) {
    this.usersRef = db.list(this.dbPath);
  }

getUserList(): AngularFireList<User> {
   
    return this.db.list('/users', ref => ref.orderByChild('name').equalTo('kushal')

  }

this works perfect filtering by name but I want to filter by multiple fields like name and email.

I know its possible by query base but I don't know how to use use it.

I saw the reference post on stack overflow and documentations but didn't able to make out what imports I need to do and how can I use it?

I know the working structure just need to get started like how can I create querybase ref like

const databaseRef = firebase.database().ref().child('people');

 const querybaseRef = querybase.ref(databaseRef, ['name', 'age', 'location']);

this code is provided in the documentation I am able to make the first line but for getting querybase.ref what I need to do?

EDIT

After running npm command for query base what are the next steps I need to follow to import queryBase to angular project ?

kushal Baldev
  • 729
  • 1
  • 14
  • 37
  • Ooh! `querybase` is old and is archived by the author. Anyways, try `import * as querybase from 'querybase';` - so that you can get the `querybase` to refer in your code. – Neelavar Aug 04 '20 at 03:36
  • ok sir thanks Will try it..!! – kushal Baldev Aug 04 '20 at 07:30
  • for the Draw back of QueryBase I was trying with Firestore to get my queries Done but getting error while running project with Firestore Imports there is something wrong with the import can you look into https://stackoverflow.com/questions/63130954/couldnt-import-firestoremodule-correctly-in-angular?noredirect=1#comment111647016_63130954 – kushal Baldev Aug 04 '20 at 07:34

0 Answers0