What steps can I take to expand the reach of my cloud functions infinitely?

Is it possible to create a cloud function that reads data from a Google spreadsheet with an unlimited range?

The goal is to extract data from the Google spreadsheets and store it in Firebase.

I am aware that in Google sheets you can use something like "Shets1!A2:L".

This is what my function looks like:

exports.readsheets_Filmes = functions.https.onRequest(async (request, response) => {
    const jwtClient = new google.auth.JWT({
        email: serviceAccount.client_email,
        key: serviceAccount.private_key,
        scopes: ['https://www.googleapis.com/auth/spreadsheets']
    })

    await jwtClient.authorize() // Authorization for access
    

    const {data} = await sheets.spreadsheets.values.get({
        auth: jwtClient,
        spreadsheetId: "",
        range: `Shets!A2:L`,
    })

    data.values?.forEach(row => {
        const [title, main_genre, genre_two] = row
        firestore.collection("Filmes").doc().set({
            title, main_genre, genre_two
        })
    })
})

I implemented this function using TypeScript.

Any solutions or suggestions to solve this issue?

Answer №1

Finally, I have found the solution to these inquiries.

By implementing this adjustment, everything started functioning smoothly.

const {info} = await documents.spreadsheets.data.fetch({
        authentication: authClient,
        documentId: "",
        section: `Sheets!A2`,
    })

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can I create a service in Angular 4 using "APP_INITIALIZER" without involving promises?

I am currently working on an app embedded within an iframe of a parent application. Upon loading my app within the iframe, I have configured an APP_INITIALIZER in my AppModule called tokenService. This service is responsible for sending a message to the p ...

Is it possible to execute multiple functions and return computed data from a single route in Node?

Struggling with making a single API call to a route in the MEAN stack to populate a chart.js graph on the front end. The API call is required to return year-to-date, month-to-date, and historical data including last year's figures. Following functiona ...

Utilizing Animate Function in Framer Motion for Object Animation

I am currently experimenting with the Framer Motion library in an attempt to create interactive movement for objects when they are clicked. My goal is to be able to relocate a component to a specific destination regardless of its initial position. I'm ...

When working with data in Angular, make sure to use any[] instead of any in app.component.html and app.component.ts to avoid causing overload errors

I'm new to working with Angular, specifically using Angular 15. I have a Rest API response that I need to parse and display in the UI using Angular. To achieve this, I employed the use of HttpClient for making GET requests and parsing the responses. ...

Anticipating the resolution of promises and observables in Angular 2

Within my accountService module, there is a dialog prompt that requests the user's username and password, returning a promise. If the user clicks on close instead of dismissing the dialog box and the validators require the input data before allowing t ...

How can we stop the parent modal from closing if the child component is not valid?

I have a main component with a modal component that takes another component as a parameter. The child modal component has some logic where I need to check if the child component is valid before closing the modal. const MainComponent: FC<IProps> => ...

When the variable type is an interface, should generics be included in the implementation of the constructor?

Here is a code snippet for you to consider: //LINE 1 private result: Map<EventType<any>, number> = new HashMap<EventType<any>, number>(); //LINE 2 private result: Map<EventType<any>, number> = new HashMap(); When the ...

Enhancing external access

I am currently working on enhancing the types of convict. The current definitions export convict using the following: namespace convict { ... } interface convict { ... } declare var convict: convict; export = convict; To augment the interface, I have mad ...

Is there a way to switch from using Fabric-based Crashlytics to Firebase-based Crashlytics?

Currently, I am working on developing an android project for my university, which is a medicine ordering app. During the development process, I came across a tutorial that guided me on implementing the LoginActivity using Firebase authentication and Fireba ...

TSLint Alert: Excessive white space detected before 'from' keyword (import-spacing)

I'm currently using WebStorm and working to maintain a specific code style: https://i.sstatic.net/r1n7n.png However, I encounter an issue where TSLint highlights my spacing and provides the following hint: "Too many spaces before 'from' ...

The issue with npm run build may be caused by a compatibility issue between TypeScript and lodash

Currently using typescript version 4.5.2 and lodash version 4.17.21 Running the command npm run build will trigger tsc && react-scripts build The following errors were encountered during the build process: node_modules/@types/lodash/common/objec ...

Guide to connecting an object's attribute with an Angular2 form element using select

Currently facing an issue with angular forms. I am attempting to set up a form that retrieves data from a mongo collection and presents it using the <select> directive. Utilizing a FormBuilder to set it up as shown below: ngOnInit() { this.addFo ...

Transmitting language codes from Wordpress Polylang to Angular applications

I am currently attempting to manage the language settings of my Angular application within WordPress using WordPress Polylang. To achieve this, I have set up the following structure in my Angular application: getLanguage.php <?php require_once(". ...

Steps to customize the color scheme in your Angular application without relying on external libraries

Is there a way to dynamically change the color scheme of an Angular app by clicking a button, without relying on any additional UI libraries? Here's what I'm trying to achieve - I have two files, dark.scss and light.scss, each containing variabl ...

Harnessing the Power of Webpack, TypeScript, and Sequelize: A Comprehensive Guide

After revising my query, I'm still encountering the same issue. The technologies I am utilizing include webpack, TypeScript, and Sequelize. My aim is to integrate Sequelize into a TypeScript backend file. I have successfully installed Sequelize and ...

Expanding index signature in an interface

Is there a way to redefine the old index signature when trying to extend an interface with different property types? I am encountering an error when adding new properties that have a different type from the original index signature. interface A { a: num ...

Storing information in Firebase using React.js

When storing an object in Firebase, I expected the structure to be as shown in the image below. However, what I received was a generated running number as a key. This is the code I used to store the object in Firebase: var location = []; location.push({ ...

Customizing Tab Navigation in React using TypeScript Parameters

Currently, my project involves developing projects using Typescript in conjunction with the React Native library. One specific task I am working on is creating a Custom Tab Bar and the necessary parameters include state, descriptors, and navigation. When ...

Unable to grab hold of specific child element within parent DOM element

Important Note: Due to the complexity of the issue, the code has been abstracted for better readability Consider a parent component structure like this: <child-component></child-component> <button (click)="doSomeClick()"> Do Some Click ...

Obtain a distinct identifier for the present instance within TypeScript code for a multi-instance Node.js backend application

In our setup, we are running a Node.js application on Kubernetes with auto-scaling enabled. I need to log specific information related to the current instance, such as the pod name or IP address. Is there a way in Node.js and Typescript to retrieve such ...