feat(doc/search): Enhance search functionality with filter and validate options for advanced query control
This commit is contained in:
@@ -225,6 +225,10 @@ await Product.search('TypeScript Aufgabe');
|
||||
|
||||
// 7: Empty query returns all documents
|
||||
await Product.search('');
|
||||
// 8: Scoped search with additional filter (e.g. multi-tenant isolation)
|
||||
await Product.search('book', { filter: { ownerId: currentUserId } });
|
||||
// 9: Post-search validation hook to drop unwanted results (e.g. price check)
|
||||
await Product.search('', { validate: (p) => p.price < 100 });
|
||||
```
|
||||
|
||||
The search functionality includes:
|
||||
|
Reference in New Issue
Block a user