Replies: 3 comments 2 replies
-
$key refers to key or node name which is string. The value you assigned to the functions orderBy, startAt and endAt argument should be string like this query.orderBy("$key").startAt("0").endAt("1643715327").limitToFirst(10); The function deleteNodesByTimestamp works on the node value as it expect integer of timestamp as argument. Edit: |
Beta Was this translation helpful? Give feedback.
-
I'm busy now and update may be available in few days or next week. |
Beta Was this translation helpful? Give feedback.
-
Sorry for late update, the library was update for days with this issue fixed. |
Beta Was this translation helpful? Give feedback.
-
My problem:
I am trying to read
JSON
object from Firebase Realtime database filtered based on theirKEY
values.What I have tried:
KEY
values of the object representsTIMESTAMPS
in seconds. I want theQuery
to filter data that are less then some given value (in m use case it will becurrentTime-30seconds
).orderByKey
without problem using following code:Now I wanted to add
.startAt()
andendAt()
functions like so:But I end up getting this error:
JSON data: Provided key index type is invalid, must be string
So i fixed the values to strings like so:
.startAt("0").endAt("1643715327")
and now I am getting this error:Constraint key field must be a valid key name
Additional info:
deleteNodesByTimestamp
method. But I came to the conclusion after testing that more accurate discussion should be in place.This is structure of my database:
Beta Was this translation helpful? Give feedback.
All reactions