@@ -113,19 +113,6 @@ function _UnsafeRestQuery(
113113 this . response = null ;
114114 this . findOptions = { } ;
115115 this . context = context || { } ;
116- const hasIgnoreIncludeErrors = Object . prototype . hasOwnProperty . call (
117- restOptions ,
118- 'ignoreIncludeErrors'
119- ) ;
120- this . ignoreIncludeErrors = hasIgnoreIncludeErrors
121- ? ! ! restOptions . ignoreIncludeErrors
122- : false ;
123- if ( hasIgnoreIncludeErrors ) {
124- this . restOptions . ignoreIncludeErrors = this . ignoreIncludeErrors ;
125- if ( this . ignoreIncludeErrors ) {
126- this . findOptions . ignoreIncludeErrors = true ;
127- }
128- }
129116 if ( ! this . auth . isMaster ) {
130117 if ( this . className == '_Session' ) {
131118 if ( ! this . auth . user ) {
@@ -218,6 +205,7 @@ function _UnsafeRestQuery(
218205 case 'includeAll' :
219206 this . includeAll = true ;
220207 break ;
208+ // Propagate these options from restOptions to findOptions too
221209 case 'explain' :
222210 case 'hint' :
223211 case 'distinct' :
@@ -226,9 +214,8 @@ function _UnsafeRestQuery(
226214 case 'limit' :
227215 case 'readPreference' :
228216 case 'comment' :
229- this . findOptions [ option ] = restOptions [ option ] ;
230- break ;
231217 case 'ignoreIncludeErrors' :
218+ this . findOptions [ option ] = restOptions [ option ] ;
232219 break ;
233220 case 'order' :
234221 var fields = restOptions . order . split ( ',' ) ;
@@ -756,9 +743,6 @@ _UnsafeRestQuery.prototype.runFind = async function (options = {}) {
756743 return Promise . resolve ( ) ;
757744 }
758745 const findOptions = Object . assign ( { } , this . findOptions ) ;
759- if ( this . ignoreIncludeErrors ) {
760- findOptions . ignoreIncludeErrors = true ;
761- }
762746 if ( this . keys ) {
763747 findOptions . keys = this . keys . map ( key => {
764748 return key . split ( '.' ) [ 0 ] ;
0 commit comments