I’m building a web app with a React front end hosted on Firebase Hosting that uses scheduled Pub/Sub Firebase Functions to scrape data and store it in a Firestore database (which is also access in the front end). This is my first time using Firebase.
tl;dr, can I do this in a Firebase Function?
const q = query(citiesRef,
or(where('capital', '==', true),
where('population', '>=', 1000000)
)
);
I’ve been trying to use the new “Logical OR” query feature for a Firestore query from within a Firebase Function. The docs show code samples implying that this feature can be used via the “Web modular API” (which seems to only be accessible via the “Web SDK”…which would mean my React front end in my case?), but also implies, for some unclear reason, that it is not usable via the “Web namespaced API” or Node.js—both of which seem to be preferred flavors within Firebase Functions, which I believe use a toolset called the “Firebase Admin SDK” to access Firestore functionality.
Basically, I’d like to use this feature within a Firebase Function. Is this just not (yet?) possible?
Other Firebase documentation led me to believe it might be possible, but I think I may have been confusing similarly named syntaxes/functionalities/services… I’m not sure. Some docs refer to it being possible to “upgrade” to a “modular SDK” version of the “Admin SDK”…and that now there’s a “2nd generation” mentioned in yet another doc which is more “modular”… but is maybe actually unrelated to the “Web modular API,” which allows the functionality I was looking to use in a Firebase Function?
Any help untangling this would be greatly appreciated!