Why is the default User Database on Parse.com called “_User”?

拈花ヽ惹草 提交于 2019-12-12 02:59:42

问题


This might be a bad question, but I'm just curious as to why Parse would name their default User table as _User. I spent about 3 hours when I first worked with parse trying to figure out why nothing would return from my queries to that table.

Only after I hovered over the table in Chrome did I see in the bottom left of my window the proper name, "_User," at the end of the URL.


回答1:


It's a special class with special handling, not to be confused with classes created by the developer which all have the same behavior. The same goes for _Installation too. Yes, it has caused some confusion, which is unfortunate. Usually our documentation carefully specifies it like this rather than using a string name:

JavaScript:

var query = new Parse.Query(Parse.User);

Android:

ParseQuery<ParseUser> query = ParseUser.getQuery();

iOS:

PFQuery *query = [PFUser query];


来源:https://stackoverflow.com/questions/24830601/why-is-the-default-user-database-on-parse-com-called-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!