@@ -20,7 +20,6 @@ function RestQuery(config, auth, className, restWhere = {}, restOptions = {}) {
2020 this . className = className ;
2121 this . restWhere = restWhere ;
2222 this . response = null ;
23-
2423 this . findOptions = { } ;
2524 if ( ! this . auth . isMaster ) {
2625 this . findOptions . acl = this . auth . user ? [ this . auth . user . id ] : null ;
@@ -205,15 +204,19 @@ RestQuery.prototype.replaceInQuery = function() {
205204 'improper usage of $inQuery' ) ;
206205 }
207206
207+ let additionalOptions = {
208+ redirectClassNameForKey : inQueryValue . redirectClassNameForKey
209+ } ;
210+
208211 var subquery = new RestQuery (
209212 this . config , this . auth , inQueryValue . className ,
210- inQueryValue . where ) ;
213+ inQueryValue . where , additionalOptions ) ;
211214 return subquery . execute ( ) . then ( ( response ) => {
212215 var values = [ ] ;
213216 for ( var result of response . results ) {
214217 values . push ( {
215218 __type : 'Pointer' ,
216- className : inQueryValue . className ,
219+ className : subquery . className ,
217220 objectId : result . objectId
218221 } ) ;
219222 }
@@ -223,7 +226,6 @@ RestQuery.prototype.replaceInQuery = function() {
223226 } else {
224227 inQueryObject [ '$in' ] = values ;
225228 }
226-
227229 // Recurse to repeat
228230 return this . replaceInQuery ( ) ;
229231 } ) ;
@@ -246,15 +248,19 @@ RestQuery.prototype.replaceNotInQuery = function() {
246248 'improper usage of $notInQuery' ) ;
247249 }
248250
251+ let additionalOptions = {
252+ redirectClassNameForKey : notInQueryValue . redirectClassNameForKey
253+ } ;
254+
249255 var subquery = new RestQuery (
250256 this . config , this . auth , notInQueryValue . className ,
251- notInQueryValue . where ) ;
257+ notInQueryValue . where , additionalOptions ) ;
252258 return subquery . execute ( ) . then ( ( response ) => {
253259 var values = [ ] ;
254260 for ( var result of response . results ) {
255261 values . push ( {
256262 __type : 'Pointer' ,
257- className : notInQueryValue . className ,
263+ className : subquery . className ,
258264 objectId : result . objectId
259265 } ) ;
260266 }
@@ -385,7 +391,6 @@ RestQuery.prototype.runFind = function() {
385391 r . className = this . redirectClassName ;
386392 }
387393 }
388-
389394 this . response = { results : results } ;
390395 } ) ;
391396} ;
@@ -423,7 +428,7 @@ RestQuery.prototype.handleInclude = function() {
423428 this . include = this . include . slice ( 1 ) ;
424429 return this . handleInclude ( ) ;
425430 }
426-
431+
427432 return pathResponse ;
428433} ;
429434
0 commit comments