I was just about to post this question on their github repository, but it looks like they prefer general inquiries to be asked here instead.
Is there a character limit for parameters when using startAt()
to retrieve data from the firebase database?
I recently encountered an issue where it appears to be restricted to only 41 characters, but I haven't been able to find any documentation confirming this.
If indeed there is a limit, is there a way to extend it? (I need to filter values with up to 60 characters)
Although I can pass longer parameters, the database seems to only filter results based on the first 41 characters and ignores the rest of the value.
Just to note, I am using the JavaScript SDK in this case.
The dataset consists of values that are approximately 100 characters long, with the first 41 characters being identical in each one, differing at the tail end:
{
"obj1": {"param": "abcdefghijklmnopqrstuvwxyz0123456789ABCDEF_0123456789ABCDEFabcdefghijklmnopqrstuvwxyz0123456789ABCDEF"},
"obj2": {"param": "abcdefghijklmnopqrstuvwxyz0123456789ABCDEF_123456789ABCDEFabcdefghijklmnopqrstuvwxyz0123456789ABCDEF"},
"obj3": {"param": "abcdefghijklmnopqrstuvwxyz0123456789ABCDEF_23456789ABCDEFabcdefghijklmnopqrstuvwxyz0123456789ABCDEF"},
"obj4": {"param": "abcdefghijklmnopqrstuvwxyz0123456789ABCDEF_3456789ABCDEFabcdefghijklmnopqrstuvwxyz0123456789ABCDEF"},
"obj5": {"param": "abcdefghijklmnopqrstuvwxyz0123456789ABCDEF_456789ABCDEFabcdefghijklmnopqrstuvwxyz0123456789ABCDEF"}
}
Currently, I need to retrieve "obj1" based on the value of the key "param," knowing only the first 60 characters of it (thus unable to use equalTo()):
var ref = firebase.database().ref("/some/data");
ref.orderByChild("param")
.startAt("abcdefghijklmnopqrstuvwxyz0123456789ABCDEF_0123456789ABCDEFabc") <- this length is 60 characters
.once("value")
.then(function(snapshot) {
snapshot.forEach(function(child) {
console.log(child.key);
});
})
My expectation was to receive only one result, but the code above returns all records from the set instead.