I have the next function using firebase in an JavaScript app. The query works fine the first time because lastDoc isn’t defined so it gets the first 7 documents in the database, but the next time when there’s a lastDoc, the query keeps returning the same first 7 docs. The lastDoc variable is updated and indeed gets the value of
Tag: firebase
i wanna save my uploaded images in a folder firebase storage
i wanna save my uploaded images in a folder called “course-cover” in firebase storage this is my code that saves uploaded images in the route of storage directly but instead of thet i wanna save them in the “course-cover” folder Answer In addition to the solution that @Dharmaraj covered in their answer, you should also get rid of the problematic
How do I get data from Firebase collection using NextJs API, Firebase Firestore, axios and TypeScript?
I’m using api routes in NextJS 13, to fetch data from Firebase like this(api/locations.tsx): Then I have a component Locations.tsx where I’m trying to store the locations in locations state object like this: But I’m getting an error Property ‘locationsData’ does not exist on type ‘GetLocationResponse’. even though I tried adding “locationsData” to my type definition type GetLocationResponse = {
How can I make Infinite Scroll using Firebase Realtime Database – v9
I want to make a Infinite scroll to load only 2 users data at first, then when admin will click on Load More button, it should load next 2 user data. Is it possible in Realtime Database? Similarly, I can use this to display users their post to limited numbers if they have many posts in the database instead to
How to delete a field inside Firestore document – The field’s key contains dots
I am trying to delete a field inside a Firestore document using the KeyPath method. In other words, I am converting the request body into keyPath string. Example, converting the below request body: Into keyPath: “preferences.settings.v1.4.3” and then using this keyPath to delete the path using the following method This would work normally if the keyPath string doesn’t contains dots.
Function does not return true even if it goes through
I can’t seem to make this work but I want to return true every-time the function executes successfully, which in this case is “Changing the password”. The res variable when called by other functions always results in false even though I see the toast message “Password changed successfully”. The if condition in above code never executes because res is always
Accessing id token of firebase 9 in axios interceptor directly
Is there a way to get the id token from firebase 9 directly in the axios interceptor? It was possible with firebase 8. currentUser is null first because it is loaded async by firebase. How can I access it directly without always having the problem that the first time it crashes because the user is not loaded yet? Thank your
API sent Firebase notifications not received on device
I’m trying to send notifications based on business logic that runs (on nodejs) on my server via a cron. Issue Notifications aren’t appearing on the device. Description I’m using the firebase admin node package. My code looks something like this My log output is something like this Everything I’m seeing suggests this should be sent! Answer sendMulticast and the Admin
“Each child in a list should have unique key” error persists after adding key prop
New to react native, and I know that each list element needs a unique key prop, but I thought I provided one here in the text element. Please guide me in the right direction. This is the array I’d like to destructure in firebase BadIngr = [“Peanuts”, “Dairy”] Answer As @jnpdx mentioned change your code as follows:
I want to connect react and firebase
I have problem with Firebase and React. This problem is after click to my add-data button for adding data to database. I get this console.log Reference_impl.ts:482 Uncaught TypeError: db._checkNotDeleted is not a function at ref (Reference_impl.ts:482:1) at insertData (Modal.js:44:1) at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1) at invokeGuardedCallback (react-dom.development.js:4277:1) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1) at executeDispatch (react-dom.development.js:9041:1) at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1) at processDispatchQueue (react-dom.development.js:9086:1)