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

140
Vistas
Back4app Parse Server Retrieved ObjectId

hi i wonder why i cannot retrieve an objectId from this json object even i can printout the stringify on console.

I can retrieve all other column with no problem but not objectId. It happen to all table in my back4app Parse server.

i need the objectId in order to update certain column in my program

below is my code

1)

   const parseQuery = new Parse.Query("User");
    parseQuery.equalTo("username", "Azha");
    let queryResult = await parseQuery
      .find()
      .then((results) => {
        results.forEach((prod) => {
//if i change below to prod.get("objectId") error undefined appear
          console.log("Product ID Available : " + prod.get("username"));
     
        });
      })
      .catch((error) => {
        console.log(error);
      });

    const parseQuery = new Parse.Query("User");
    parseQuery.equalTo("username", "Azha");
    try {
      let todos = await parseQuery.find();
      if (todos.length > 0) {
//if i change below to todos[0].get("objectId") error undefined appear
        console.log("yes Approval : " + todos[0].get("companyname"));
      } else {
        console.log("No Approval");
      }
      console.log("- value is : " + JSON.stringify(todos));
      console.log("----------------------");  
    } catch (error) {
  
      Alert.alert("Error!", error.message);
     
    }

below is the json printout

[{"sessionToken":"r:d9166aa9d7143463c46725d095b53946","username":"Azha","createdAt":"2021-09-21T15:27:01.088Z","updatedAt":"2021-10-10T13:01:27.126Z","companyname":"XXX","fullname":"XXX","email":"azha@abc.com.my","emailVerified":true,"accesslevel":"Maintenence","companydivision":"Maintenence","position":"Technician","phonenumber":"999","userteam":"B","useremail":"azha@abc.com.my","ACL":{"*":{"read":true},"IuBGmCtxyu":{"read":true,"write":true}},"objectId":"IuBGmCtxyu"}]

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Yes i just found my solution. Using object1 below:

   const parseQuery = new Parse.Query("User");
    parseQuery.equalTo("username", "Azha");

    try {
      let todos = await parseQuery.find();
      var object1 = JSON.parse(JSON.stringify(todos));
  
      console.log("2- value is : " + object1[0].objectId);

    
    } catch (error) {

      Alert.alert("Error!", error.message);
 
    }

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