From 969b073939fdd8185391502fdc104ead941509a6 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 21 Apr 2025 17:31:30 +0000 Subject: [PATCH] fix(readme): Update readme to clarify usage of searchable fields retrieval --- changelog.md | 6 ++++++ readme.md | 4 ++-- ts/00_commitinfo_data.ts | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 143511e..b710197 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/readme.md b/readme.md index 4bf8719..381a318 100644 --- a/readme.md +++ b/readme.md @@ -203,7 +203,7 @@ class Product extends SmartDataDbDoc { } // 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*`) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index b6faae8..efc710e 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -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.' }