@@ -20,7 +20,6 @@ function RestQuery(config, auth, className, restWhere = {}, restOptions = {}) {
20
20
this . className = className ;
21
21
this . restWhere = restWhere ;
22
22
this . response = null ;
23
-
24
23
this . findOptions = { } ;
25
24
if ( ! this . auth . isMaster ) {
26
25
this . findOptions . acl = this . auth . user ? [ this . auth . user . id ] : null ;
@@ -205,15 +204,19 @@ RestQuery.prototype.replaceInQuery = function() {
205
204
'improper usage of $inQuery' ) ;
206
205
}
207
206
207
+ let additionalOptions = {
208
+ redirectClassNameForKey : inQueryValue . redirectClassNameForKey
209
+ } ;
210
+
208
211
var subquery = new RestQuery (
209
212
this . config , this . auth , inQueryValue . className ,
210
- inQueryValue . where ) ;
213
+ inQueryValue . where , additionalOptions ) ;
211
214
return subquery . execute ( ) . then ( ( response ) => {
212
215
var values = [ ] ;
213
216
for ( var result of response . results ) {
214
217
values . push ( {
215
218
__type : 'Pointer' ,
216
- className : inQueryValue . className ,
219
+ className : subquery . className ,
217
220
objectId : result . objectId
218
221
} ) ;
219
222
}
@@ -223,7 +226,6 @@ RestQuery.prototype.replaceInQuery = function() {
223
226
} else {
224
227
inQueryObject [ '$in' ] = values ;
225
228
}
226
-
227
229
// Recurse to repeat
228
230
return this . replaceInQuery ( ) ;
229
231
} ) ;
@@ -246,15 +248,19 @@ RestQuery.prototype.replaceNotInQuery = function() {
246
248
'improper usage of $notInQuery' ) ;
247
249
}
248
250
251
+ let additionalOptions = {
252
+ redirectClassNameForKey : notInQueryValue . redirectClassNameForKey
253
+ } ;
254
+
249
255
var subquery = new RestQuery (
250
256
this . config , this . auth , notInQueryValue . className ,
251
- notInQueryValue . where ) ;
257
+ notInQueryValue . where , additionalOptions ) ;
252
258
return subquery . execute ( ) . then ( ( response ) => {
253
259
var values = [ ] ;
254
260
for ( var result of response . results ) {
255
261
values . push ( {
256
262
__type : 'Pointer' ,
257
- className : notInQueryValue . className ,
263
+ className : subquery . className ,
258
264
objectId : result . objectId
259
265
} ) ;
260
266
}
@@ -385,7 +391,6 @@ RestQuery.prototype.runFind = function() {
385
391
r . className = this . redirectClassName ;
386
392
}
387
393
}
388
-
389
394
this . response = { results : results } ;
390
395
} ) ;
391
396
} ;
@@ -423,7 +428,7 @@ RestQuery.prototype.handleInclude = function() {
423
428
this . include = this . include . slice ( 1 ) ;
424
429
return this . handleInclude ( ) ;
425
430
}
426
-
431
+
427
432
return pathResponse ;
428
433
} ;
429
434
0 commit comments