Back4app Parse Server 检索到的 ObjectId 可以通过以下代码示例进行获取:
Parse.Object.extend('_User').get(id, { useMasterKey: true }).then((user) => {
const objectId = user.id;
// Do something with the objectId
})
其中,_User
可以替换为你需要获取 ObjectId 的 class 名称,id
是该 class 中某一对象的 objectId,objectId
则是获取到的 objectId。需要注意的是,为了获取 objectId,需要在获取对象的 Promise 中传递 { useMasterKey: true }
选项,这将使用 Parse Server 中的“master key”权限来获取 objectId。