@@ -728,10 +728,10 @@ export type InternalSearchStageOptions = Omit<
728728 firestore . Pipelines . SearchStageOptions ,
729729 'query' | 'sort' | 'select' | 'addFields'
730730> & {
731- query : firestore . Pipelines . BooleanExpression ;
732- sort ?: Array < firestore . Pipelines . Ordering > ;
733- select ?: Record < string , firestore . Pipelines . Expression > ;
734- addFields ?: Record < string , firestore . Pipelines . Expression > ;
731+ query : BooleanExpression ;
732+ sort ?: Array < Ordering > ;
733+ select ?: Record < string , Expression > ;
734+ addFields ?: Record < string , Expression > ;
735735} ;
736736
737737/**
@@ -742,6 +742,25 @@ export class Search implements Stage {
742742
743743 constructor ( private options : InternalSearchStageOptions ) { }
744744
745+ _validateUserData ( ignoreUndefinedProperties : boolean ) : void {
746+ validateUserDataHelper ( this . options . query , ignoreUndefinedProperties ) ;
747+ if ( this . options . sort ) {
748+ validateUserDataHelper ( this . options . sort , ignoreUndefinedProperties ) ;
749+ }
750+ if ( this . options . select ) {
751+ validateUserDataHelper (
752+ Object . values ( this . options . select ) as Expression [ ] ,
753+ ignoreUndefinedProperties ,
754+ ) ;
755+ }
756+ if ( this . options . addFields ) {
757+ validateUserDataHelper (
758+ Object . values ( this . options . addFields ) as Expression [ ] ,
759+ ignoreUndefinedProperties ,
760+ ) ;
761+ }
762+ }
763+
745764 readonly optionsUtil = new OptionsUtil ( {
746765 query : {
747766 serverName : 'query' ,
@@ -841,7 +860,7 @@ export class DeleteStage implements Stage {
841860 } ;
842861 }
843862
844- _validateUserData ( ignoreUndefinedProperties : boolean ) : void { }
863+ _validateUserData ( _ : boolean ) : void { }
845864}
846865
847866/**
0 commit comments