What is the _localId and where did the id go?

Hello,

I noticed that I can no longer access the id of the newly created parse objects.

      const Order = Parse.Object.extend("Orders");
      const newOrder = new Order();
      newOrder.set(...)
      newOrder.save(null, { useMasterKey: true });
console.log(newOrder);

gives

ParseObjectSubclass {
  className: 'Orders',
  _objCount: 54,
  _localId: 'localfc58ef5b-a5d3-472a-beac-e1937da4124f'
}

What is _localId and how can I access the objectId of the newly created object?

I use

"parse": "^4.0.1",
"parse-server": "^6.0.0",

Thank you,

Ok I found out that you get _localId instead of id if you don’t await the .save() method.

1 Like