File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -644,6 +644,17 @@ Deno.test('data', async (t) => {
644
644
} ) ,
645
645
)
646
646
647
+ assert (
648
+ await adapter . indexDocuments ( {
649
+ db : 'foo' ,
650
+ fields : [ { name : 'ASC' } , { foo : 'ASC' } ] ,
651
+ name : 'idx-name' ,
652
+ partialFilter : {
653
+ type : 'user' ,
654
+ } ,
655
+ } ) ,
656
+ )
657
+
647
658
await assertRejects ( ( ) =>
648
659
adapter . indexDocuments ( {
649
660
db : 'foo' ,
@@ -667,6 +678,16 @@ Deno.test('data', async (t) => {
667
678
// @ts -ignore
668
679
adapter . indexDocuments ( { db : 'foo' , fields : [ 'name' ] , name : 123 } )
669
680
)
681
+
682
+ await assertRejects ( ( ) =>
683
+ // @ts -ignore
684
+ adapter . indexDocuments ( {
685
+ db : 'foo' ,
686
+ fields : [ 'name' ] ,
687
+ name : 'idx-name' ,
688
+ partialFilter : 123 ,
689
+ } )
690
+ )
670
691
} )
671
692
672
693
await t . step ( 'should validate the outputs' , async ( ) => {
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ export const port = z.object({
123
123
db : z . string ( ) ,
124
124
name : z . string ( ) ,
125
125
fields : z . union ( [ z . array ( z . string ( ) ) , z . array ( z . record ( SortEnum ) ) ] ) ,
126
+ partialFilter : z . record ( z . any ( ) ) . optional ( ) ,
126
127
} ) ,
127
128
)
128
129
. returns ( z . promise ( hyperResponse ( { } ) ) ) ,
You can’t perform that action at this time.
0 commit comments