I am having trouble getting the right result back from firebase.
My code is
const rootRef = firebase.database().ref()
console.log(rootRef)
const allEmployees = rootRef.child('employees').orderByChild('name').startAt('J')
console.log("These are all employees which names start with a J" + allEmployees)
This is the result in the console
Reference {repo: Repo, path: Path, queryParams_: QueryParams,
orderByCalled_: false}
database: (...)
key: (...)
orderByCalled_: false
parent: (...)
path: Path {pieces_: Array(0), pieceNum_: 0}
queryParams_: QueryParams {limitSet_: false, startSet_: false,
startNameSet_: false, endSet_: false, endNameSet_: false, …}
ref: (...)
repo: Repo {repoInfo_: RepoInfo, app: FirebaseAppImpl, dataUpdateCount:
0, statsListener_: null, eventQueue_: EventQueue, …}
root: (...)
__proto__: Query
These are all employees which names start with a J https://xxxxxxxx .firebaseio.com/employees
What I try to achieve is to get a list of employees printed that meet the condition, that is where their name starts with a J.
I have also tried to match a category an employee falls into
rootRef.child('employees').orderByChild('categoryID').equalTo('608Av3zkDS0cg2Iu66b2')
console.log(allEmployees)
But this gave the same result, the url of the database.
Can someone please help me. I have been breaking my head on this for hours.