0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

parse cloud code でリクエストを投げてきたユーザーのIDを取得するときの注意点

Posted at

mbaasって便利ですね。

parse を使って開発をしている時にハマったもので解決したのを紹介。

cloud code でリクエストを投げてきたユーザーのデータは以下のコードだと request.user に入っています。

Parse.Cloud.beforeSave("hogehoge", function(request, response) {
code....
}

このユーザーのID(objectId) を取得しようとして

Parse.Cloud.beforeSave("hogehoge", function(request, response) {
	console.log(request.user.get("objectId"));
}

ってしても

No Message provided

とエラーが出ます。

正しくは

Parse.Cloud.beforeSave("hogehoge", function(request, response) {
	console.log(request.user.id);
}

でした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?