Get all classes in Parse-server

廉价感情. 提交于 2019-12-13 05:51:44

问题


I'm writing a backup job, and need to fetch all classes in Parse-server, so I can then query all rows and export them.

How do I fetch all classes?

Thanks


回答1:


Query the schemas collection.

GET /parse/schemas

Probably need to use the masterkey on the query. Not sure what language you're writing your job in but should be simple for you to create a REST query or create a node.js script and use the javascript/node api

--Added after comment below --

var Parse = require('parse/node').Parse;
Parse.serverURL = "http://localhost:23740/parse";
Parse.initialize('APP_ID', 'RESTKEY', 'MASTERKEY');

var Schema = Parse.Object.extend("_SCHEMA");
var query = new Parse.Query(Schema);

query.find({
  success : (results) => {
  console.log(JSON.stringify(results));
},
 error : (err) => {
 console.log("err : " + JSON.stringify(err));
 }});


来源:https://stackoverflow.com/questions/37967657/get-all-classes-in-parse-server

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