如何在parse.com JavaScript中实现联接查询? [英] How implement join queries in parse.com javascript?

查看:61
本文介绍了如何在parse.com JavaScript中实现联接查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是解析服务器(parse.com)上的新手.我有两个类"students_records"和"students_fee".我将费用记录存储在"students_fee"类中,在"student_id"列中具有"students_records"的objectId.现在,我想通过一个查询来收集两个类的记录,这类似于我们在mysql中基于"students_fee"类中的"fee_year"列进行的联接查询.例如,获取所有具有"fee_year" = 2016和"student_id" ="students_records"的objectId的学生,这是链接 https://parseplatform.github.io/docs/js/guide/我目前正在获得帮助,但是我找不到这样的东西.谁能告诉我该怎么做?

I am new on parse server ( parse.com ). I have two classes "students_records" and "students_fee". I am storing fee records in class "students_fee" with objectId of "students_records" in column "student_id". Now I want to collect records from both classes by one query similar to join query we do in mysql with base on column 'fee_year' in class "students_fee". for example get all students who have 'fee_year'=2016 and 'student_id'=objectId of "students_records", this is link https://parseplatform.github.io/docs/js/guide/ of guide I am currently getting help, but i can't find such thing. Can anyone tell me how to do that?

谢谢.

推荐答案

由于在后台使用MongoDB(NoSQL)进行解析,因此没有真正的联接".您可以做的是创建一个从学生到记录的数组关系,然后在查询中使用 include 以便将所有记录包括在学生下.

Since parse use MongoDB (NoSQL) behind the scenes there is no real "join". What you can do is to create a array relationship from students to records and then use include in your query in order to include all the records under a student.

您可以在此处了解更多信息.

You can read more about it here.

为了简化操作,我建议您在此处使用Parse SDK. Parse SDK适用于所有流行的编程语言(例如iOS,Android,PHP,JavaScript等)

I recommend you to use Parse SDK's here in order to keep it simple. the Parse SDK is available for all the popular programming languages (e.g. iOS, Android, PHP, JavaScript and more)

这篇关于如何在parse.com JavaScript中实现联接查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆