Skip to content

Commit a8b46aa

Browse files
committed
Add example on using dot notation in related query.
1 parent 0e20593 commit a8b46aa

File tree

5 files changed

+182
-12850
lines changed

5 files changed

+182
-12850
lines changed

Gemfile.lock

Lines changed: 143 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,88 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (5.1.4)
5-
concurrent-ruby (~> 1.0, >= 1.0.2)
4+
activesupport (4.2.9)
65
i18n (~> 0.7)
76
minitest (~> 5.1)
7+
thread_safe (~> 0.3, >= 0.3.4)
88
tzinfo (~> 1.1)
99
addressable (2.5.2)
1010
public_suffix (>= 2.0.2, < 4.0)
1111
coffee-script (2.4.1)
1212
coffee-script-source
1313
execjs
14-
coffee-script-source (1.12.2)
15-
colorator (0.1)
14+
coffee-script-source (1.11.1)
15+
colorator (1.1.0)
16+
commonmarker (0.17.10)
17+
ruby-enum (~> 0.5)
1618
concurrent-ruby (1.0.5)
1719
ethon (0.11.0)
1820
ffi (>= 1.3.0)
1921
execjs (2.7.0)
20-
faraday (0.13.1)
22+
faraday (0.15.2)
2123
multipart-post (>= 1.2, < 3)
22-
ffi (1.9.18)
23-
gemoji (2.1.0)
24-
github-pages (86)
25-
github-pages-health-check (= 1.1.0)
26-
jekyll (= 3.1.6)
27-
jekyll-coffeescript (= 1.0.1)
28-
jekyll-feed (= 0.5.1)
29-
jekyll-gist (= 1.4.0)
30-
jekyll-github-metadata (= 2.0.2)
31-
jekyll-mentions (= 1.1.3)
24+
ffi (1.9.25)
25+
forwardable-extended (2.6.0)
26+
gemoji (3.0.0)
27+
github-pages (177)
28+
activesupport (= 4.2.9)
29+
github-pages-health-check (= 1.3.5)
30+
jekyll (= 3.8.4)
31+
jekyll-avatar (= 0.5.0)
32+
jekyll-coffeescript (= 1.0.2)
33+
jekyll-commonmark-ghpages (= 0.1.5)
34+
jekyll-default-layout (= 0.1.4)
35+
jekyll-feed (= 0.9.2)
36+
jekyll-gist (= 1.4.1)
37+
jekyll-github-metadata (= 2.9.3)
38+
jekyll-mentions (= 1.2.0)
39+
jekyll-optional-front-matter (= 0.3.0)
3240
jekyll-paginate (= 1.1.0)
33-
jekyll-redirect-from (= 0.10.0)
34-
jekyll-sass-converter (= 1.3.0)
35-
jekyll-seo-tag (= 2.0.0)
36-
jekyll-sitemap (= 0.10.0)
37-
jemoji (= 0.6.2)
38-
kramdown (= 1.11.1)
39-
liquid (= 3.0.6)
41+
jekyll-readme-index (= 0.2.0)
42+
jekyll-redirect-from (= 0.12.1)
43+
jekyll-relative-links (= 0.5.2)
44+
jekyll-remote-theme (= 0.2.3)
45+
jekyll-sass-converter (= 1.5.0)
46+
jekyll-seo-tag (= 2.3.0)
47+
jekyll-sitemap (= 1.1.1)
48+
jekyll-swiss (= 0.4.0)
49+
jekyll-theme-architect (= 0.1.0)
50+
jekyll-theme-cayman (= 0.1.0)
51+
jekyll-theme-dinky (= 0.1.0)
52+
jekyll-theme-hacker (= 0.1.0)
53+
jekyll-theme-leap-day (= 0.1.0)
54+
jekyll-theme-merlot (= 0.1.0)
55+
jekyll-theme-midnight (= 0.1.0)
56+
jekyll-theme-minimal (= 0.1.0)
57+
jekyll-theme-modernist (= 0.1.0)
58+
jekyll-theme-primer (= 0.5.2)
59+
jekyll-theme-slate (= 0.1.0)
60+
jekyll-theme-tactile (= 0.1.0)
61+
jekyll-theme-time-machine (= 0.1.0)
62+
jekyll-titles-from-headings (= 0.5.0)
63+
jemoji (= 0.8.1)
64+
kramdown (= 1.16.2)
65+
liquid (= 4.0.0)
4066
listen (= 3.0.6)
4167
mercenary (~> 0.3)
42-
rouge (= 1.11.1)
68+
minima (= 2.1.1)
69+
nokogiri (>= 1.8.1, < 2.0)
70+
rouge (= 2.2.1)
4371
terminal-table (~> 1.4)
4472
github-pages-health-check (1.3.5)
4573
addressable (~> 2.3)
4674
net-dns (~> 0.8)
4775
octokit (~> 4.0)
4876
public_suffix (~> 2.0)
4977
typhoeus (~> 0.7)
50-
html-pipeline (2.7.1)
78+
html-pipeline (2.8.4)
5179
activesupport (>= 2)
5280
nokogiri (>= 1.4)
53-
i18n (0.9.1)
81+
i18n (0.9.5)
5482
concurrent-ruby (~> 1.0)
55-
jekyll (3.1.6)
56-
colorator (~> 0.1)
83+
jekyll (3.6.2)
84+
addressable (~> 2.4)
85+
colorator (~> 1.0)
5786
jekyll-sass-converter (~> 1.0)
5887
jekyll-watch (~> 1.1)
5988
kramdown (~> 1.14)
@@ -80,49 +109,110 @@ GEM
80109
jekyll (~> 3.3)
81110
jekyll-gist (1.4.1)
82111
octokit (~> 4.2)
83-
jekyll-github-metadata (2.0.2)
112+
jekyll-github-metadata (2.9.3)
84113
jekyll (~> 3.1)
85-
octokit (~> 4.0)
86-
jekyll-mentions (1.1.3)
114+
octokit (~> 4.0, != 4.4.0)
115+
jekyll-mentions (1.2.0)
116+
activesupport (~> 4.0)
87117
html-pipeline (~> 2.3)
88118
jekyll (~> 3.0)
89119
jekyll-optional-front-matter (0.3.0)
90120
jekyll (~> 3.0)
91121
jekyll-paginate (1.1.0)
92-
jekyll-redirect-from (0.10.0)
93-
jekyll (>= 2.0)
94-
jekyll-sass-converter (1.3.0)
95-
sass (~> 3.2)
96-
jekyll-seo-tag (2.0.0)
97-
jekyll (~> 3.1)
98-
jekyll-sitemap (0.10.0)
99-
jekyll-watch (1.5.0)
100-
listen (~> 3.0, < 3.1)
101-
jemoji (0.6.2)
102-
gemoji (~> 2.0)
122+
jekyll-readme-index (0.2.0)
123+
jekyll (~> 3.0)
124+
jekyll-redirect-from (0.12.1)
125+
jekyll (~> 3.3)
126+
jekyll-relative-links (0.5.2)
127+
jekyll (~> 3.3)
128+
jekyll-remote-theme (0.2.3)
129+
jekyll (~> 3.5)
130+
rubyzip (>= 1.2.2, < 3.0)
131+
typhoeus (>= 0.7, < 2.0)
132+
jekyll-sass-converter (1.5.0)
133+
sass (~> 3.4)
134+
jekyll-seo-tag (2.3.0)
135+
jekyll (~> 3.3)
136+
jekyll-sitemap (1.1.1)
137+
jekyll (~> 3.3)
138+
jekyll-swiss (0.4.0)
139+
jekyll-theme-architect (0.1.0)
140+
jekyll (~> 3.5)
141+
jekyll-seo-tag (~> 2.0)
142+
jekyll-theme-cayman (0.1.0)
143+
jekyll (~> 3.5)
144+
jekyll-seo-tag (~> 2.0)
145+
jekyll-theme-dinky (0.1.0)
146+
jekyll (~> 3.5)
147+
jekyll-seo-tag (~> 2.0)
148+
jekyll-theme-hacker (0.1.0)
149+
jekyll (~> 3.5)
150+
jekyll-seo-tag (~> 2.0)
151+
jekyll-theme-leap-day (0.1.0)
152+
jekyll (~> 3.5)
153+
jekyll-seo-tag (~> 2.0)
154+
jekyll-theme-merlot (0.1.0)
155+
jekyll (~> 3.5)
156+
jekyll-seo-tag (~> 2.0)
157+
jekyll-theme-midnight (0.1.0)
158+
jekyll (~> 3.5)
159+
jekyll-seo-tag (~> 2.0)
160+
jekyll-theme-minimal (0.1.0)
161+
jekyll (~> 3.5)
162+
jekyll-seo-tag (~> 2.0)
163+
jekyll-theme-modernist (0.1.0)
164+
jekyll (~> 3.5)
165+
jekyll-seo-tag (~> 2.0)
166+
jekyll-theme-primer (0.5.2)
167+
jekyll (~> 3.5)
168+
jekyll-github-metadata (~> 2.9)
169+
jekyll-seo-tag (~> 2.2)
170+
jekyll-theme-slate (0.1.0)
171+
jekyll (~> 3.5)
172+
jekyll-seo-tag (~> 2.0)
173+
jekyll-theme-tactile (0.1.0)
174+
jekyll (~> 3.5)
175+
jekyll-seo-tag (~> 2.0)
176+
jekyll-theme-time-machine (0.1.0)
177+
jekyll (~> 3.5)
178+
jekyll-seo-tag (~> 2.0)
179+
jekyll-titles-from-headings (0.5.0)
180+
jekyll (~> 3.3)
181+
jekyll-watch (1.5.1)
182+
listen (~> 3.0)
183+
jemoji (0.8.1)
184+
activesupport (~> 4.0, >= 4.2.9)
185+
gemoji (~> 3.0)
103186
html-pipeline (~> 2.2)
104187
jekyll (>= 3.0)
105-
kramdown (1.11.1)
106-
liquid (3.0.6)
188+
kramdown (1.16.2)
189+
liquid (4.0.0)
107190
listen (3.0.6)
108191
rb-fsevent (>= 0.9.3)
109192
rb-inotify (>= 0.9.7)
110193
mercenary (0.3.6)
111194
mini_portile2 (2.3.0)
112-
minitest (5.10.3)
195+
minima (2.1.1)
196+
jekyll (~> 3.3)
197+
minitest (5.11.3)
113198
multipart-post (2.0.0)
114199
net-dns (0.8.0)
115-
nokogiri (1.8.1)
200+
nokogiri (1.8.4)
116201
mini_portile2 (~> 2.3.0)
117-
octokit (4.7.0)
202+
octokit (4.9.0)
118203
sawyer (~> 0.8.0, >= 0.5.3)
119-
public_suffix (1.5.3)
120-
rb-fsevent (0.10.2)
204+
pathutil (0.16.1)
205+
forwardable-extended (~> 2.6)
206+
public_suffix (2.0.5)
207+
rb-fsevent (0.10.3)
121208
rb-inotify (0.9.10)
122209
ffi (>= 0.5.0, < 2)
123-
rouge (1.11.1)
210+
rouge (2.2.1)
211+
ruby-enum (0.7.2)
212+
i18n
213+
rubyzip (1.2.2)
124214
safe_yaml (1.0.4)
125-
sass (3.5.3)
215+
sass (3.5.7)
126216
sass-listen (~> 4.0.0)
127217
sass-listen (4.0.0)
128218
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -135,9 +225,9 @@ GEM
135225
thread_safe (0.3.6)
136226
typhoeus (0.8.0)
137227
ethon (>= 0.8.0)
138-
tzinfo (1.2.4)
228+
tzinfo (1.2.5)
139229
thread_safe (~> 0.1)
140-
unicode-display_width (1.3.0)
230+
unicode-display_width (1.4.0)
141231

142232
PLATFORMS
143233
ruby
@@ -148,4 +238,4 @@ DEPENDENCIES
148238
jekyll-redirect-from
149239

150240
BUNDLED WITH
151-
1.16.0
241+
1.16.5

_includes/android/queries.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,19 @@ losingUserQuery.findInBackground(new FindCallback<ParseUser>() {
152152
}
153153
});
154154
```
155+
<p>To filter rows based on <code class="highlighter-rouge">objectId</code>’s from pointers in a second table, you can use dot notation:</p>
156+
157+
```java
158+
ParseQuery<ParseObject> chartersOfTypeX = ParseQuery.getQuery("Charter");
159+
charterOfTypeX.equalTo('type', 'x');
160+
161+
ParseQuery<ParseObject> groupsWithoutCharterX = ParseQuery.getQuery("Group");
162+
groupsWithoutCharterX.doesNotMatchKeyInQuery("objectId", "belongsTo.objectId", chartersOfTypeX);
163+
groupsWithoutCharterX.findInBackground(new FindCallback<ParseObject>() {
164+
void done(List<ParseObject> results, ParseException e) {
165+
// results has the list of groups without charter x
166+
});
167+
```
155168

156169
You can restrict the fields returned by calling `selectKeys` with a collection of keys. To retrieve documents that contain only the `score` and `playerName` fields (and also special built-in fields such as `objectId`, `createdAt`, and `updatedAt`):
157170

_includes/js/queries.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,19 @@ losingUserQuery.doesNotMatchKeyInQuery("hometown", "city", teamQuery);
130130
const results = await losingUserQuery.find();
131131
```
132132

133+
To filter rows based on `objectId`'s from pointers in a second table, you can use dot notation:
134+
135+
<pre><code class="javascript">
136+
const rolesOfTypeX = new Parse.Query('Role');
137+
rolesOfTypeX.equalTo('type', 'x');
138+
139+
const groupsWithRoleX = new Parse.Query('Group');
140+
groupsWithRoleX.matchesKeyInQuery('objectId', 'belongsTo.objectId', rolesOfTypeX);
141+
groupsWithRoleX.find().then(function(results) {
142+
// results has the list of groups with role x
143+
});
144+
</pre></code>
145+
133146
You can restrict the fields returned by calling `select` with a list of keys. To retrieve documents that contain only the `score` and `playerName` fields (and also special built-in fields such as `objectId`, `createdAt`, and `updatedAt`):
134147

135148
```javascript

_includes/php/queries.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ $results = $losingUserQuery->find();
161161

162162
### Select
163163

164+
To filter rows based on `objectId`'s from pointers in a second table, you can use dot notation:
165+
166+
<pre><code class="php">
167+
$rolesOfTypeX = new ParseQuery('Role');
168+
$rolesOfTypeX->equalTo('type', 'x');
169+
170+
$groupsWithRoleX = new ParseQuery('Group');
171+
$groupsWithRoleX->matchesKeyInQuery('objectId', 'belongsTo.objectId', rolesOfTypeX);
172+
$results = $groupsWithRoleX->find();
173+
// results has the list of groups with role x
174+
</pre></code>
175+
164176
You can restrict the fields returned by calling `select` with an array of keys. To retrieve documents that contain only the `score` and `playerName` fields (and also special built-in fields such as `objectId`, `createdAt`, and `updatedAt`):
165177

166178
```php

assets/js/bundle.js

Lines changed: 1 addition & 12797 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)