Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
How to save thousand data in Parse Platform NodeJS

I am new to the parse platform and i'm trying to insert 81000 rows of data in to the Parse DB, here the code

        const uri = "/the.json"
        const res = await axios.get(uri)
        const dataresult = Object.keys(res.data)

        if (dataresult.length > 0) {
            res.data.forEach(function (datakp) {
                var kp = new Parse.Object("theClass");
                kp.save(datakp)
                    .then((res) => {
                        console.log('oke ' + res.id)
                    }),
                    (error) => {
                        console.log('err : '+ error.message)
                    }
            })
         }

There is no error in console log, and no data is saved in Parse DB, but if I only insert 1000 rows, it will save to the database.

EG:

            if (dataresult.length > 0) {
            res.data.forEach(function (datakp, index) {
                if (index < 1000) {
                 var kp = new Parse.Object("theClass");
                 kp.save(datakp)
                    .then((res) => {
                        console.log('oke ' + res.id)
                    }),
                    (error) => {
                        console.log('err : '+ error.message)
                    }
                })
               }
           }

Thank You

UPDATE

I fix this case based on answer @davi-macêdo here a complete code

    const uri = "/the.json"
    const res = await axios.get(uri)
    const dataresult = Object.keys(res.data)
    const objs = [];
    const theKP = Parse.Object.extend("theClass")
    if (dataresult.length > 0) {
        res.data.forEach(function (datakp) {
            var thekp = new theKP()
            thekp.set(datakp)
            objs.push(thekp);
        })
     }

    Parse.Object.saveAll(objs)
                .then((res) => {
                    console.log('oke updated ' + dataresult.length)
                }),
                (error) => {
                    console.log('err : '+ error.message)
                }
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The most efficient way is using Parse.Object.saveAll function. Something like this:

        const uri = "/the.json"
        const res = await axios.get(uri)
        const dataresult = Object.keys(res.data)
        const objs = [];

        if (dataresult.length > 0) {
            res.data.forEach(function (datakp) {
                objs.push(new Parse.Object("theClass", datakp));
            })
         }

        Parse.Object.saveAll(objs)
                    .then((res) => {
                        console.log('oke ' + res.id)
                    }),
                    (error) => {
                        console.log('err : '+ error.message)
                    }

Anyways, since you have no error and no data currently being saved, you might be kitting some memory limit. So that's something you also need to be aware about.

about 4 years ago · Juan Pablo Isaza Denunciar

0

You're probably hitting rate limits, I can't imagine saving 81,000 records in one shot is normal behaviour for many applications.

I looked through the documentation and couldn't find anything that might mention a save limit, however sending 1000 requests would trigger most rate limit protection

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda