fix(readme): Update readme to clarify usage of searchable fields retrieval
This commit is contained in:
parent
ac80f90ae0
commit
969b073939
@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-04-21 - 5.11.2 - fix(readme)
|
||||
Update readme to clarify usage of searchable fields retrieval
|
||||
|
||||
- Replaced getSearchableFields('Product') with Product.getSearchableFields()
|
||||
- Updated documentation to reference the static method Class.getSearchableFields()
|
||||
|
||||
## 2025-04-21 - 5.11.1 - fix(doc)
|
||||
Refactor searchable fields API and improve collection registration.
|
||||
|
||||
|
@ -203,7 +203,7 @@ class Product extends SmartDataDbDoc<Product, Product> {
|
||||
}
|
||||
|
||||
// List searchable fields
|
||||
const searchableFields = getSearchableFields('Product');
|
||||
const searchableFields = Product.getSearchableFields();
|
||||
|
||||
// 1: Exact phrase across all fields
|
||||
await Product.search('"Kindle Paperwhite"');
|
||||
@ -230,7 +230,7 @@ await Product.search('');
|
||||
The search functionality includes:
|
||||
|
||||
- `@searchable()` decorator for marking fields as searchable
|
||||
- `getSearchableFields()` to list searchable fields for a model
|
||||
- `Class.getSearchableFields()` static method to list searchable fields for a model
|
||||
- `search(query: string)` method supporting:
|
||||
- Exact phrase matches (`"my exact string"` or `'my exact string'`)
|
||||
- Field‑scoped exact & wildcard searches (`field:value`, `field:Air*`)
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartdata',
|
||||
version: '5.11.1',
|
||||
version: '5.11.2',
|
||||
description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user