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 ?

2
  • 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. Commented Aug 4, 2020 at 3:36
  • 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 stackoverflow.com/questions/63130954/… Commented Aug 4, 2020 at 7:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.