Compare commits

...

2 Commits

Author SHA1 Message Date
c5a44da975 5.11.2
Some checks failed
Default (tags) / security (push) Successful in 38s
Default (tags) / test (push) Successful in 3m0s
Default (tags) / release (push) Failing after 52s
Default (tags) / metadata (push) Successful in 58s
2025-04-21 17:31:30 +00:00
969b073939 fix(readme): Update readme to clarify usage of searchable fields retrieval 2025-04-21 17:31:30 +00:00
4 changed files with 10 additions and 4 deletions

View File

@ -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.

View File

@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartdata",
"version": "5.11.1",
"version": "5.11.2",
"private": false,
"description": "An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.",
"main": "dist_ts/index.js",

View File

@ -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'`)
- Fieldscoped exact & wildcard searches (`field:value`, `field:Air*`)

View File

@ -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.'
}