You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use constrainsts startAfter and endBefore without keys using REST.
"{ "error" : "Constraint key field must be a valid key name" } "
Due to the placeholders MAX_NAME and MIN_NAME being included in the generated url. startAfter(2) "http://127.0.0.1:9000/things.json?ns=mydb-default-rtdb&orderBy=%22pNumber%22&startAfter=2%2C%22%5BMAX_NAME%5D%22&format=export"
What you're trying to do
Use startAt or endBefore in a query
What the expected behaviour is
It works when the js sdk uses REST due to being crawled ( or have manually created a Repo that forces REST ).
What the real behaviour is "{ "error" : "Constraint key field must be a valid key name" } "
Code snippets to help us reproduce the issue
Given a list of things where a Thing has a field pNumber onValue(query(ref(db,"things"), orderByChild("pNumber"), startAt(2)), (snapshot) => { });
To see the error you will need to add a break point in the constructor for the Repo class and set the forceRestClient to true.
constructor(
public repoInfo_: RepoInfo,
public forceRestClient_: boolean,
public authTokenProvider_: AuthTokenProvider,
public appCheckProvider_: AppCheckTokenProvider
) {
// This key is intentionally not updated if RepoInfo is later changed or replaced
this.key = this.repoInfo_.toURLString();
}
Operating System
Windows 11
Environment (if applicable)
Version 128.0.6613.115 (Official Build) (64-bit)
Firebase SDK Version
^10.12.2
Firebase SDK Product(s)
Database
Project Tooling
React, typescript with Parcel
Detailed Problem Description
use constrainsts startAfter and endBefore without keys using REST.
"{ "error" : "Constraint key field must be a valid key name" } "
Due to the placeholders MAX_NAME and MIN_NAME being included in the generated url.
startAfter(2)
"http://127.0.0.1:9000/things.json?ns=mydb-default-rtdb&orderBy=%22pNumber%22&startAfter=2%2C%22%5BMAX_NAME%5D%22&format=export"
endBefore(2)
http://127.0.0.1:9000/things.json?ns=mydb-default-rtdb&orderBy=%22pNumber%22&endBefore=2%2C%22%5BMIN_NAME%5D%22&format=export
See
firebase-js-sdk/packages/database/src/core/view/QueryParams.ts
Line 277 in 15c36cc
firebase-js-sdk/packages/database/src/core/view/QueryParams.ts
Line 313 in 15c36cc
If being crawled will use REST
firebase-js-sdk/packages/database/src/core/Repo.ts
Line 218 in 15c36cc
Steps and code to reproduce issue
//Links in problem description should suffice
The text was updated successfully, but these errors were encountered: