dobo 2.33.0 → 2.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -193,7 +193,7 @@ async function adapterFactory () {
193
193
  if (prop.type === 'datetime') {
194
194
  const dt = this.useUtc ? dayjs.utc(item[prop.name]) : dayjs(item[prop.name])
195
195
  item[prop.name] = dt.toDate()
196
- } else if (['object', 'array'].includes(prop.type)) item[prop.name] = JSON.parse(item[prop.name])
196
+ } else if (isString(item[prop.name]) && ['object', 'array'].includes(prop.type)) item[prop.name] = JSON.parse(item[prop.name])
197
197
  } catch (err) {
198
198
  item[prop.name] = null
199
199
  }
@@ -10,6 +10,11 @@
10
10
  * @param {boolean} [opts.forceNoHidden=false] - If `true`, force ALL fields to be picked, thus ignoring hidden fields. If an array, force all fields except those in the array to be picked.
11
11
  * @param {boolean} [opts.fmt=false] - If `true`, add a `_fmt` property to the sanitized record with formatted values automatically based on the model's properties and rules
12
12
  * @param {Object} [opts.req] - Request object, used for formatting values based on request context
13
+ * @param {Object} [opts.i18n] - Internationalization options, used for formatting values based on i18n context
14
+ * @param {string} [opts.i18n.lang] - Language code for formatting values
15
+ * @param {string} [opts.i18n.dateStyle] - Date style for formatting date values
16
+ * @param {string} [opts.i18n.timeStyle] - Time style for formatting time values
17
+ * @param {string} [opts.i18n.timeZone] - Time zone for formatting date/time values
13
18
  * @returns {Object} Returns sanitized record object
14
19
  */
15
20
  async function sanitizeRecord (record = {}, opts = {}) {
@@ -51,11 +56,11 @@ async function sanitizeRecord (record = {}, opts = {}) {
51
56
  else if (isString(prop.format)) newRecord._fmt[key] = await callHandler(this.plugin, this, value, newRecord, opts)
52
57
  else {
53
58
  const options = {
54
- lang: get(opts, 'req.lang'),
59
+ lang: get(opts, 'i18n.lang', get(opts, 'req.lang')),
55
60
  datetime: {
56
- dateStyle: get(opts, 'req.site.setting.sumba.dateStyle'),
57
- timeStyle: get(opts, 'req.site.setting.sumba.timeStyle'),
58
- timeZone: get(opts, 'req.site.setting.sumba.timeZone')
61
+ dateStyle: get(opts, 'i18n.dateStyle', get(opts, 'req.site.setting.sumba.dateStyle')),
62
+ timeStyle: get(opts, 'i18n.timeStyle', get(opts, 'req.site.setting.sumba.timeStyle')),
63
+ timeZone: get(opts, 'i18n.timeZone', get(opts, 'req.site.setting.sumba.timeZone'))
59
64
  },
60
65
  latitude: ['lat', 'latitude'].includes(key),
61
66
  longitude: ['lon', 'lng', 'longitude'].includes(key)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dobo",
3
- "version": "2.33.0",
3
+ "version": "2.34.1",
4
4
  "description": "DBMS for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-07-28
4
+
5
+ - [2.34.1] Bug fix in `adapter.sanitizeRecord()`
6
+
7
+ ## 2026-07-26
8
+
9
+ - [2.34.0] Add `options.i18n` to `model.sanitizeRecord()`
10
+
3
11
  ## 2026-07-24
4
12
 
5
13
  - [2.33.0] Change `selfBind` to `bindThis`
@@ -12,286 +20,286 @@
12
20
 
13
21
  ## 2026-06-29
14
22
 
15
- - [2.31.0] Add ```dobo.driver:{before|after}Any```
23
+ - [2.31.0] Add `dobo.driver:{before|after}Any`
16
24
 
17
25
  ## 2026-06-24
18
26
 
19
- - [2.30.5] Bug fix in ```model.sanitizeBody()```
20
- - [2.30.5] Bug fix in ```model.sanitizeRecord()```
21
- - [2.30.6] Bug fix in ```driver.sanitizeRecord()```
22
- - [2.30.7] Bug fix in ```util.getRefs()```
23
- - [2.30.7] Bug fix in ```model.sanitizeBody()```
24
- - [2.30.7] Bug fix in ```model.sanitizeRecord()```
27
+ - [2.30.5] Bug fix in `model.sanitizeBody()`
28
+ - [2.30.5] Bug fix in `model.sanitizeRecord()`
29
+ - [2.30.6] Bug fix in `driver.sanitizeRecord()`
30
+ - [2.30.7] Bug fix in `util.getRefs()`
31
+ - [2.30.7] Bug fix in `model.sanitizeBody()`
32
+ - [2.30.7] Bug fix in `model.sanitizeRecord()`
25
33
 
26
34
  ## 2026-06-16
27
35
 
28
- - [2.30.4] Bug fix in ```model.sanitizeBody()```
29
- - [2.30.4] Bug fix in ```model._prepBodyForCreate()```
36
+ - [2.30.4] Bug fix in `model.sanitizeBody()`
37
+ - [2.30.4] Bug fix in `model._prepBodyForCreate()`
30
38
 
31
39
  ## 2026-06-13
32
40
 
33
- - [2.30.2] Bug fix in ```model.findAllRecord()```
34
- - [2.30.2] Bug fix in ```memory.findAllRecord()```
35
- - [2.30.2] Bug fix in ```collect-models.js```
36
- - [2.30.3] Bug fix in ```memory.findRecord()```
41
+ - [2.30.2] Bug fix in `model.findAllRecord()`
42
+ - [2.30.2] Bug fix in `memory.findAllRecord()`
43
+ - [2.30.2] Bug fix in `collect-models.js`
44
+ - [2.30.3] Bug fix in `memory.findRecord()`
37
45
 
38
46
  ## 2026-06-12
39
47
 
40
- - [2.30.0] Necessary updates to ```bajo@2.18.0``` specs
41
- - [2.30.0] Add ```sanitizeByType()```
42
- - [2.30.0] Add ```error._abortAction``` to abort an action in driver level
43
- - [2.30.0] Refactor ```model.sanitizeBody()``` to use shared sanitizing function
44
- - [2.30.1] Bug fix in ```model.sanitizeBody()```
48
+ - [2.30.0] Necessary updates to `bajo@2.18.0` specs
49
+ - [2.30.0] Add `sanitizeByType()`
50
+ - [2.30.0] Add `error._abortAction` to abort an action in driver level
51
+ - [2.30.0] Refactor `model.sanitizeBody()` to use shared sanitizing function
52
+ - [2.30.1] Bug fix in `model.sanitizeBody()`
45
53
 
46
54
  ## 2026-06-11
47
55
 
48
- - [2.29.1] Bug fix in ```model.sanitizeBody()```
49
- - [2.29.2] Bug fix in ```model.sanitizeBody()```
56
+ - [2.29.1] Bug fix in `model.sanitizeBody()`
57
+ - [2.29.2] Bug fix in `model.sanitizeBody()`
50
58
 
51
59
  ## 2026-06-10
52
60
 
53
- - [2.29.0] Feature ```dobo:immutable``` now using array instead of boolean
54
- - [2.29.0] Add ```model.sanitizeFixture()```
55
- - [2.29.0] Options ```noMagic``` no without touching ```noModelHook```
56
- - [2.29.0] Add ```array``` validator type
61
+ - [2.29.0] Feature `dobo:immutable` now using array instead of boolean
62
+ - [2.29.0] Add `model.sanitizeFixture()`
63
+ - [2.29.0] Options `noMagic` no without touching `noModelHook`
64
+ - [2.29.0] Add `array` validator type
57
65
 
58
66
  ## 2026-06-03
59
67
 
60
- - [2.28.0] Property ```values``` can now accept a function that will be called dynamically upon used
61
- - [2.28.0] ```_util.buildPropValues()``` now become a new model method
62
- - [2.28.0] Bug fix in ```model.sanitizeRecord()```
63
- - [2.28.0] Bug fix in ```model.validate()```
68
+ - [2.28.0] Property `values` can now accept a function that will be called dynamically upon used
69
+ - [2.28.0] `_util.buildPropValues()` now become a new model method
70
+ - [2.28.0] Bug fix in `model.sanitizeRecord()`
71
+ - [2.28.0] Bug fix in `model.validate()`
64
72
 
65
73
  ## 2026-05-30
66
74
 
67
- - [2.27.0] Bug fix in ```model.transaction()```
68
- - [2.27.0] Add ```model:[before|after]RecordValidation``` model hooks
69
- - [2.27.0] Bug fix in ```model.countRecord()```
70
- - [2.27.0] Bug fix in ```model.loadFixtures()```
71
- - [2.27.1] Bug fix in ```model.sanitizeRecord()```
72
- - [2.27.2] Bug fix in ```collect-models.js```
75
+ - [2.27.0] Bug fix in `model.transaction()`
76
+ - [2.27.0] Add `model:[before|after]RecordValidation` model hooks
77
+ - [2.27.0] Bug fix in `model.countRecord()`
78
+ - [2.27.0] Bug fix in `model.loadFixtures()`
79
+ - [2.27.1] Bug fix in `model.sanitizeRecord()`
80
+ - [2.27.2] Bug fix in `collect-models.js`
73
81
 
74
82
  ## 2026-05-29
75
83
 
76
- - [2.26.1] Bug fix in ```model.createRecord()```
77
- - [2.26.1] Bug fix in ```model.updateRecord()```
78
- - [2.26.1] Bug fix in ```model.upsertRecord()```
79
- - [2.26.1] Bug fix in ```model.removeRecord()```
80
- - [2.26.4] Bug fix in ```model.listAttachment()```
84
+ - [2.26.1] Bug fix in `model.createRecord()`
85
+ - [2.26.1] Bug fix in `model.updateRecord()`
86
+ - [2.26.1] Bug fix in `model.upsertRecord()`
87
+ - [2.26.1] Bug fix in `model.removeRecord()`
88
+ - [2.26.4] Bug fix in `model.listAttachment()`
81
89
 
82
90
  ## 2026-05-26
83
91
 
84
- - [2.26.0] Add loading multiple model schema as in one ```model.js``` file
92
+ - [2.26.0] Add loading multiple model schema as in one `model.js` file
85
93
  - [2.26.0] Remove caching feature of model schema
86
- - [2.26.0] Change driver hook name with this syntax: ```dobo.driver:<action>```
87
- - [2.26.1] Bug fix in ```memory.js```
88
- - [2.26.2] Bug fix in ```driver.js```
94
+ - [2.26.0] Change driver hook name with this syntax: `dobo.driver:<action>`
95
+ - [2.26.1] Bug fix in `memory.js`
96
+ - [2.26.2] Bug fix in `driver.js`
89
97
 
90
98
  ## 2026-05-22
91
99
 
92
- - [2.25.0] Add ```array``` & ```object``` validator handling
93
- - [2.25.0] Change ```interSite``` definition to ```xSite```
94
- - [2.25.0] Add ```model.getNonVirtualProperties()```
95
- - [2.25.0] Bug fix in ```model.loadFixtures()```
96
- - [2.25.0] Handle ```array``` validation schema
100
+ - [2.25.0] Add `array` & `object` validator handling
101
+ - [2.25.0] Change `interSite` definition to `xSite`
102
+ - [2.25.0] Add `model.getNonVirtualProperties()`
103
+ - [2.25.0] Bug fix in `model.loadFixtures()`
104
+ - [2.25.0] Handle `array` validation schema
97
105
 
98
106
  ## 2026-05-16
99
107
 
100
- - [2.24.0] Change ```dobo:immutable``` feature, field no longer hidden
101
- - [2.24.0] Add ```dobo:[before|after]driver<Action>``` hook
102
- - [2.24.0] Add ```dobo.<modelName>:[before|after]driver<Action>``` hook
103
- - [2.24.0] Change ```model._simpleLookup()```
104
- - [2.24.0] Remove ```dobo:[before|after]Build[Query|Search]``` hook
105
- - [2.24.0] Change ```model.loadFixtures()```
106
- - [2.24.0] Bugfix in ```model.sanitizeBody()```
107
- - [2.24.0] Add ```dobo:afterTransaction``` hook
108
- - [2.24.0] Add ```dobo.<modelName>:afterTransaction``` hook
108
+ - [2.24.0] Change `dobo:immutable` feature, field no longer hidden
109
+ - [2.24.0] Add `dobo:[before|after]driver<Action>` hook
110
+ - [2.24.0] Add `dobo.<modelName>:[before|after]driver<Action>` hook
111
+ - [2.24.0] Change `model._simpleLookup()`
112
+ - [2.24.0] Remove `dobo:[before|after]Build[Query|Search]` hook
113
+ - [2.24.0] Change `model.loadFixtures()`
114
+ - [2.24.0] Bugfix in `model.sanitizeBody()`
115
+ - [2.24.0] Add `dobo:afterTransaction` hook
116
+ - [2.24.0] Add `dobo.<modelName>:afterTransaction` hook
109
117
 
110
118
  ## 2026-05-11
111
119
 
112
- - [2.23.0] Add ```beforeBulkCreate``` model hook on ```dobo:unique``` feature
113
- - [2.23.0] Add ```beforeBulkCreate``` model hook on ```dobo:updatedAt``` feature
114
- - [2.23.0] Add ```beforeBulkCreate``` model hook on ```dobo:unique``` feature
115
- - [2.23.0] Add ```connection.initdriver()```
116
- - [2.23.0] Move ```model.file``` in model definition to ```model.options.file```
117
- - [2.23.0] Move ```model.attachment``` in model definition to ```model.options.attachment```
118
- - [2.23.0] Add ```model.buildStart()``` and ```model.buildEnd()``` in model definition
119
- - [2.23.0] Add ```null``` driver
120
- - [2.23.0] Add ```model.syncIdField()```
121
- - [2.23.0] Rename method to ```model.bulkCreateRecord``` instead ```bulkCreateRecords```. The later name now serve only as alias
122
- - [2.23.0] Remove ```getSingleRef()``` and ```getMultiRefs()```, use ```getRefs()``` instead
123
- - [2.23.0] Add reference support for ```array``` column type
124
- - [2.23.0] Bug fix in ```model.findAllRecord()```, now use correctly hook names
125
- - [2.23.0] Bug fix in ```model.sanitizeBody()```
126
- - [2.23.0] Bug fix in ```model.sanitizeRecord()```
120
+ - [2.23.0] Add `beforeBulkCreate` model hook on `dobo:unique` feature
121
+ - [2.23.0] Add `beforeBulkCreate` model hook on `dobo:updatedAt` feature
122
+ - [2.23.0] Add `beforeBulkCreate` model hook on `dobo:unique` feature
123
+ - [2.23.0] Add `connection.initdriver()`
124
+ - [2.23.0] Move `model.file` in model definition to `model.options.file`
125
+ - [2.23.0] Move `model.attachment` in model definition to `model.options.attachment`
126
+ - [2.23.0] Add `model.buildStart()` and `model.buildEnd()` in model definition
127
+ - [2.23.0] Add `null` driver
128
+ - [2.23.0] Add `model.syncIdField()`
129
+ - [2.23.0] Rename method to `model.bulkCreateRecord` instead `bulkCreateRecords`. The later name now serve only as alias
130
+ - [2.23.0] Remove `getSingleRef()` and `getMultiRefs()`, use `getRefs()` instead
131
+ - [2.23.0] Add reference support for `array` column type
132
+ - [2.23.0] Bug fix in `model.findAllRecord()`, now use correctly hook names
133
+ - [2.23.0] Bug fix in `model.sanitizeBody()`
134
+ - [2.23.0] Bug fix in `model.sanitizeRecord()`
127
135
 
128
136
  ## 2026-05-03
129
137
 
130
- - [2.22.1] Bug fix in ```dobo:image``` feature
138
+ - [2.22.1] Bug fix in `dobo:image` feature
131
139
 
132
140
  ## 2026-05-02
133
141
 
134
142
  - [2.22.0] Add auto thumbnail creation when image attachment is uploaded
135
143
  - [2.22.0] Add feature to get the thumbnail instead of attachment file in attachment route
136
- - [2.22.0] Add ```dobo:image``` feature
137
- - [2.22.0] Bug fix in ```model.createRecord()```
138
- - [2.22.0] Bug fix in ```model.updateRecord()```
139
- - [2.22.0] Bug fix in ```model.upsertRecord()```
140
- - [2.22.0] Bug fix in ```model.removeRecord()```
144
+ - [2.22.0] Add `dobo:image` feature
145
+ - [2.22.0] Bug fix in `model.createRecord()`
146
+ - [2.22.0] Bug fix in `model.updateRecord()`
147
+ - [2.22.0] Bug fix in `model.upsertRecord()`
148
+ - [2.22.0] Bug fix in `model.removeRecord()`
141
149
  - [2.22.0] Remove attachment now also remove corresponding thumbnails
142
150
 
143
151
  ## 2026-04-28
144
152
 
145
- - [2.21.1] Bug fix in ```collect-models.js```
146
- - [2.21.1] Bug fix in ```driver._updateRecord()```
147
- - [2.21.1] Bug fix in ```util.getMultiRef()```
153
+ - [2.21.1] Bug fix in `collect-models.js`
154
+ - [2.21.1] Bug fix in `driver._updateRecord()`
155
+ - [2.21.1] Bug fix in `util.getMultiRef()`
148
156
  - [2.21.1] Bug fix in setting references
149
- - [2.21.1] Bug fix in ```model.sanitizeRecord()```
157
+ - [2.21.1] Bug fix in `model.sanitizeRecord()`
150
158
 
151
159
  ## 2026-04-25
152
160
 
153
- - [2.21.0] Change ```options.formatValue``` to ```options.fmt```
154
- - [2.21.0] Remove ```options.retainOriginalValue``` since it is not needed anymore
155
- - [2.21.0] Remove ```formatValue``` altogether
156
- - [2.21.0] Remove ```record._orig```, in exchange switch the formatted value to ```record._fmt```
157
- - [2.21.0] Add ```property.virtual``` to set property is a virtual/calculated property
161
+ - [2.21.0] Change `options.formatValue` to `options.fmt`
162
+ - [2.21.0] Remove `options.retainOriginalValue` since it is not needed anymore
163
+ - [2.21.0] Remove `formatValue` altogether
164
+ - [2.21.0] Remove `record._orig`, in exchange switch the formatted value to `record._fmt`
165
+ - [2.21.0] Add `property.virtual` to set property is a virtual/calculated property
158
166
  - [2.21.0] Add necessary safe guards for virtual property
159
- - [2.21.0] Add ```model.getProperties()```
160
- - [2.21.0] Add ```model.getIndexes()```
161
- - [2.21.0] Add ```model.getVirtualPropertties()```
162
- - [2.21.0] Activate transaction on ```loadFixtures()```
167
+ - [2.21.0] Add `model.getProperties()`
168
+ - [2.21.0] Add `model.getIndexes()`
169
+ - [2.21.0] Add `model.getVirtualPropertties()`
170
+ - [2.21.0] Activate transaction on `loadFixtures()`
163
171
 
164
172
  ## 2026-04-23
165
173
 
166
- - [2.20.1] Bug fix in ```collect-models.js```, now with deep merge in advance
174
+ - [2.20.1] Bug fix in `collect-models.js`, now with deep merge in advance
167
175
 
168
176
  ## 2026-04-21
169
177
 
170
- - [2.19.1] Bug fix in ```collect-models.js```, now values are sanitized with ```parseObject()```
171
- - [2.19.1] Bug fix in ```options.dataOnly``` on all model methods
172
- - [2.19.1] Add ```options.noMagic```
178
+ - [2.19.1] Bug fix in `collect-models.js`, now values are sanitized with `parseObject()`
179
+ - [2.19.1] Bug fix in `options.dataOnly` on all model methods
180
+ - [2.19.1] Add `options.noMagic`
173
181
  - [2.20.0] Revert back to NOT using hooks for caching
174
182
 
175
183
  ## 2026-04-19
176
184
 
177
- - [2.19.0] Add ```queryAny()``` for query using model's scanables fields
178
- - [2.19.0] Bug fix in ```reviveRegexInJson()```
185
+ - [2.19.0] Add `queryAny()` for query using model's scanables fields
186
+ - [2.19.0] Bug fix in `reviveRegexInJson()`
179
187
  - [2.19.0] Bug fix in query sanitizing especially for regex existance
180
- - [2.19.0] Remove ```replaceIdInQuerySearch()``` in ```_util.js``` as it isn't needed anymore
188
+ - [2.19.0] Remove `replaceIdInQuerySearch()` in `_util.js` as it isn't needed anymore
181
189
 
182
190
  ## 2026-04-18
183
191
 
184
- - [2.18.2] Bug fix in ```config``` object
185
- - [2.18.2] Bug fix in ```getDefaultValues```
186
- - [2.18.2] Bug fix in ```sanitizeProp()``` in ```collect-models.js```
187
- - [2.18.2] Bug fix in ```sanitizeRecord()``` for prop with ```format``` set to ```false```
192
+ - [2.18.2] Bug fix in `config` object
193
+ - [2.18.2] Bug fix in `getDefaultValues`
194
+ - [2.18.2] Bug fix in `sanitizeProp()` in `collect-models.js`
195
+ - [2.18.2] Bug fix in `sanitizeRecord()` for prop with `format` set to `false`
188
196
 
189
197
  ## 2026-04-17
190
198
 
191
- - [2.18.1] Bug fix in ```model.createAttachment()```
192
- - [2.18.1] Bug fix in ```model.sanitizeBody()```
193
- - [2.18.1] Bug fix in ```model.sanitizeRecord()```
199
+ - [2.18.1] Bug fix in `model.createAttachment()`
200
+ - [2.18.1] Bug fix in `model.sanitizeBody()`
201
+ - [2.18.1] Bug fix in `model.sanitizeRecord()`
194
202
 
195
203
  ## 2026-04-16
196
204
 
197
- - [2.18.0] Add parameter options to ```sanitizeObject()```
198
- - [2.18.0] Rewrite ```dobo:dt``` feature to support customization
199
- - [2.18.0] Bug fix in ```model.createRecord()```
200
- - [2.18.0] Changes in ```model.sanitizeBody()``` to throw error with payload details
201
- - [2.18.0] Changes in ```model.sanitizeRecord()``` to support ```options.retainOriginalValue```
202
- - [2.18.0] Bug fix in ```model.updateRecord()```
203
- - [2.18.0] Bug fix in ```model.upsertRecord()```
205
+ - [2.18.0] Add parameter options to `sanitizeObject()`
206
+ - [2.18.0] Rewrite `dobo:dt` feature to support customization
207
+ - [2.18.0] Bug fix in `model.createRecord()`
208
+ - [2.18.0] Changes in `model.sanitizeBody()` to throw error with payload details
209
+ - [2.18.0] Changes in `model.sanitizeRecord()` to support `options.retainOriginalValue`
210
+ - [2.18.0] Bug fix in `model.updateRecord()`
211
+ - [2.18.0] Bug fix in `model.upsertRecord()`
204
212
 
205
213
  ## 2026-04-13
206
214
 
207
- - [2.17.0] Add ```{ strict }``` as parameter to ```sanitizeObject()```
215
+ - [2.17.0] Add `{ strict }` as parameter to `sanitizeObject()`
208
216
 
209
217
  ## 2026-04-11
210
218
 
211
- - [2.16.0] Add ```format``` as new model's property key
212
- - [2.16.0] Rewrite ```getDefaultValues()``` to base on ```req.getSetting()```
213
- - [2.16.0] All inter site admins are now exempts from ```immutable``` row
214
- - [2.16.0] Bug fix in ```collect-models.js```
215
- - [2.16.0] Bug fix in ```getRefs()``` and ```getRefs()```
216
- - [2.16.0] Add feature to return formatted row(s) with ```options.formatValue```
217
- - [2.16.0] If row is formatted, add feature to save original row in ```_orig``` with ```options.retainOriginalValue```
219
+ - [2.16.0] Add `format` as new model's property key
220
+ - [2.16.0] Rewrite `getDefaultValues()` to base on `req.getSetting()`
221
+ - [2.16.0] All inter site admins are now exempts from `immutable` row
222
+ - [2.16.0] Bug fix in `collect-models.js`
223
+ - [2.16.0] Bug fix in `getRefs()` and `getRefs()`
224
+ - [2.16.0] Add feature to return formatted row(s) with `options.formatValue`
225
+ - [2.16.0] If row is formatted, add feature to save original row in `_orig` with `options.retainOriginalValue`
218
226
 
219
227
  ## 2026-04-07
220
228
 
221
- - [2.15.0] Add ```parseNql()```
222
- - [2.15.0] Add ```parseQuery()```
223
- - [2.15.0] Add ```replaceRegexInJson()```
224
- - [2.15.0] Add ```reviveRegexInJson()```
225
- - [2.15.0] Change all ```opts.fieldName``` to ```opts.field``` in features
226
- - [2.15.0] Add ```ref.searchField``` in model reference
227
- - [2.15.0] Add ```ref.labelField``` in model reference
228
- - [2.15.0] Add ```ref.valueField``` in model reference
229
- - [2.15.0] change ```ref.propName``` to ```ref.field``` in model reference
229
+ - [2.15.0] Add `parseNql()`
230
+ - [2.15.0] Add `parseQuery()`
231
+ - [2.15.0] Add `replaceRegexInJson()`
232
+ - [2.15.0] Add `reviveRegexInJson()`
233
+ - [2.15.0] Change all `opts.fieldName` to `opts.field` in features
234
+ - [2.15.0] Add `ref.searchField` in model reference
235
+ - [2.15.0] Add `ref.labelField` in model reference
236
+ - [2.15.0] Add `ref.valueField` in model reference
237
+ - [2.15.0] change `ref.propName` to `ref.field` in model reference
230
238
 
231
239
  ## 2026-04-02
232
240
 
233
- - [2.14.1] Bug fix in ```hardCap```
234
- - [2.14.1] ```warnings``` now can be turned off through ```config``` or site settings
241
+ - [2.14.1] Bug fix in `hardCap`
242
+ - [2.14.1] `warnings` now can be turned off through `config` or site settings
235
243
 
236
244
  ## 2026-04-01
237
245
 
238
- - [2.14.0] Add ```between``` as custom query, since it doesn't exists in NQL
246
+ - [2.14.0] Add `between` as custom query, since it doesn't exists in NQL
239
247
 
240
248
  ## 2026-03-30
241
249
 
242
- - [2.12.0] Add ```.bootorder``` level 10
243
- - [2.12.0] Bug fix in ```model._simpleLookup()```
250
+ - [2.12.0] Add `.bootorder` level 10
251
+ - [2.12.0] Bug fix in `model._simpleLookup()`
244
252
  - [2.12.0] Add model name in validation error's payload
245
- - [2.13.0] Add ```hardCap``` support
253
+ - [2.13.0] Add `hardCap` support
246
254
 
247
255
  ## 2026-03-26
248
256
 
249
- - [2.11.4] Exceptions thrown in ```getRefs()``` && ```getRefs()``` will be catched and are ignored
257
+ - [2.11.4] Exceptions thrown in `getRefs()` && `getRefs()` will be catched and are ignored
250
258
 
251
259
  ## 2026-03-25
252
260
 
253
261
  - [2.11.2] Bug fix in result sets cache
254
- - [2.11.3] Bug fix in cache handling if ```bajoCache``` isn't loaded
262
+ - [2.11.3] Bug fix in cache handling if `bajoCache` isn't loaded
255
263
 
256
264
  ## 2026-03-17
257
265
 
258
- - [2.11.1] Bug fix on ```model.validate()```: if ```partial``` is true, set ```fields``` from ```body``` keys
266
+ - [2.11.1] Bug fix on `model.validate()`: if `partial` is true, set `fields` from `body` keys
259
267
 
260
268
  ## 2026-03-16
261
269
 
262
- - [2.11.0] Attachment can now listed by its type (```image```, ```video```, etc)
263
- - [2.11.0] Add ```_last``` to autodetect last item in list in ```@id.js```
270
+ - [2.11.0] Attachment can now listed by its type (`image`, `video`, etc)
271
+ - [2.11.0] Add `_last` to autodetect last item in list in `@id.js`
264
272
 
265
273
  ## 2026-03-12
266
274
 
267
- - [2.10.1] Bug fix in ```model._simpleLookup()``` should return ```null``` if query results empty value
275
+ - [2.10.1] Bug fix in `model._simpleLookup()` should return `null` if query results empty value
268
276
 
269
277
  ## 2026-03-11
270
278
 
271
- - [2.10.0] Add ```immutable``` and ```feature``` to the list of allowed property keys
272
- - [2.10.0] Set ```property.feature``` to the name of feature name if property is build using ```feature```
273
- - [2.10.0] Add ```model._simpleLookup()```
274
- - [2.10.0] Refactor ```model.loadFixtures()```
275
- - [2.10.0] Add ```property.immutable``` for property that can't be updated
279
+ - [2.10.0] Add `immutable` and `feature` to the list of allowed property keys
280
+ - [2.10.0] Set `property.feature` to the name of feature name if property is build using `feature`
281
+ - [2.10.0] Add `model._simpleLookup()`
282
+ - [2.10.0] Refactor `model.loadFixtures()`
283
+ - [2.10.0] Add `property.immutable` for property that can't be updated
276
284
 
277
285
  ## 2026-03-09
278
286
 
279
- - [2.9.3] Bug fix in ```model.findAllRecord```
287
+ - [2.9.3] Bug fix in `model.findAllRecord`
280
288
 
281
289
  ## 2026-03-07
282
290
 
283
- - [2.9.2] Bug fix in ```model.loadFixtures()```
284
- - [2.9.2] Bug fix in ```collect-connections.js```
291
+ - [2.9.2] Bug fix in `model.loadFixtures()`
292
+ - [2.9.2] Bug fix in `collect-connections.js`
285
293
 
286
294
  ## 2026-03-06
287
295
 
288
- - [2.9.1] Bug fix in ```model.sanitizeBody()```
296
+ - [2.9.1] Bug fix in `model.sanitizeBody()`
289
297
 
290
298
  ## 2026-03-05
291
299
 
292
- - [2.9.0] Add transaction support with ```model.transaction()``` wrapper
293
- - [2.9.0] Add property ```driver.support.transaction``` to indicate a driver is fully support transaction or not
294
- - [2.9.0] Add property ```connection.options.connName```
300
+ - [2.9.0] Add transaction support with `model.transaction()` wrapper
301
+ - [2.9.0] Add property `driver.support.transaction` to indicate a driver is fully support transaction or not
302
+ - [2.9.0] Add property `connection.options.connName`
295
303
 
296
304
  ## 2026-02-25
297
305
 
@@ -299,24 +307,24 @@
299
307
 
300
308
  ## 2026-02-24
301
309
 
302
- - [2.8.2] Bug fix in field type ```textType```
303
- - [2.8.2] Bug fix in ```collect-models.js``` when empty model is returned
310
+ - [2.8.2] Bug fix in field type `textType`
311
+ - [2.8.2] Bug fix in `collect-models.js` when empty model is returned
304
312
 
305
313
  ## 2026-02-23
306
314
 
307
- - [2.8.1] Bug fix in ```memory._getCursor()```
308
- - [2.8.1] Bug fix in ```model.upsertRecord()```
315
+ - [2.8.1] Bug fix in `memory._getCursor()`
316
+ - [2.8.1] Bug fix in `model.upsertRecord()`
309
317
 
310
318
  ## 2026-02-22
311
319
 
312
- - [2.8.0] Add ```warnings``` to response object
313
- - [2.8.0] Throw error if ```page``` above the allowed threshold
320
+ - [2.8.0] Add `warnings` to response object
321
+ - [2.8.0] Throw error if `page` above the allowed threshold
314
322
 
315
323
  ## 2026-02-20
316
324
 
317
- - [2.7.0] Add ```prop.values``` support
318
- - [2.7.0] Add ```prop.rulesMsg``` support
319
- - [2.7.0] Change ```buildFromDbModel()``` on validation to async function
325
+ - [2.7.0] Add `prop.values` support
326
+ - [2.7.0] Add `prop.rulesMsg` support
327
+ - [2.7.0] Change `buildFromDbModel()` on validation to async function
320
328
 
321
329
  ## 2026-02-17
322
330
 
@@ -326,11 +334,11 @@
326
334
 
327
335
  ## 2026-02-05
328
336
 
329
- - [2.6.4] Bug fix in driver options, ```noCheckUnique``` must be perform in ```create```, ```update``` and ```upsert```
337
+ - [2.6.4] Bug fix in driver options, `noCheckUnique` must be perform in `create`, `update` and `upsert`
330
338
 
331
339
  ## 2026-02-03
332
340
 
333
- - [2.6.3] Bug fix in ```model.sanitizeRecord()```
341
+ - [2.6.3] Bug fix in `model.sanitizeRecord()`
334
342
 
335
343
  ## 2026-02-02
336
344
 
@@ -338,24 +346,24 @@
338
346
 
339
347
  ## 2026-02-01
340
348
 
341
- - [2.6.0] Add ```model.scanables``` for fields that can participate in table scans if necessary
342
- - [2.6.0] Add ```driver.support.search``` for driver's fulltext search support
343
- - [2.6.0] Add model hooks ```before/afterBuildQuery/Search```
349
+ - [2.6.0] Add `model.scanables` for fields that can participate in table scans if necessary
350
+ - [2.6.0] Add `driver.support.search` for driver's fulltext search support
351
+ - [2.6.0] Add model hooks `before/afterBuildQuery/Search`
344
352
 
345
353
  ## 2026-01-30
346
354
 
347
- - [2.5.0] Add feature to push custom ```options._data```. If provided, this will be used instead of auto generated one.
348
- - [2.5.0] Remove ```silent``` in ```options``` object
349
- - [2.5.1] driver now support ```this.useUtc``` for database that store values in UTC string
350
- - [2.5.1] Bug fix in ```driver.sanitizeRecord()```
355
+ - [2.5.0] Add feature to push custom `options._data`. If provided, this will be used instead of auto generated one.
356
+ - [2.5.0] Remove `silent` in `options` object
357
+ - [2.5.1] driver now support `this.useUtc` for database that store values in UTC string
358
+ - [2.5.1] Bug fix in `driver.sanitizeRecord()`
351
359
 
352
360
  ## 2026-01-29
353
361
 
354
- - [2.4.0] Add ```bulkCreateRecord()``` on model & driver
355
- - [2.4.0] Add ```execModelHook()```
362
+ - [2.4.0] Add `bulkCreateRecord()` on model & driver
363
+ - [2.4.0] Add `execModelHook()`
356
364
  - [2.4.0] Bug fix in models collection
357
- - [2.4.0] Add ```DoboAction``` to the ```app.baseClass```
358
- - [2.4.0] ```findAllRecord()``` can't be called as action
365
+ - [2.4.0] Add `DoboAction` to the `app.baseClass`
366
+ - [2.4.0] `findAllRecord()` can't be called as action
359
367
 
360
368
  ## 2026-01-26
361
369
 
@@ -364,22 +372,22 @@
364
372
 
365
373
  ## 2026-01-24
366
374
 
367
- - [2.3.0] Add ```dynHooks``` to model's options
368
- - [2.3.0] Add ```dobo:unique``` feature
369
- - [2.3.0] Add ```noWait``` handler for model's hook
375
+ - [2.3.0] Add `dynHooks` to model's options
376
+ - [2.3.0] Add `dobo:unique` feature
377
+ - [2.3.0] Add `noWait` handler for model's hook
370
378
 
371
379
  ## 2026-01-21
372
380
 
373
- - [2.2.5] Add ```proto``` to ```connection.options```
381
+ - [2.2.5] Add `proto` to `connection.options`
374
382
 
375
383
  ## 2026-01-19
376
384
 
377
- - [2.2.4] Bug fix in route ```dobo:/attachment/...```
385
+ - [2.2.4] Bug fix in route `dobo:/attachment/...`
378
386
 
379
387
  ## 2026-01-18
380
388
 
381
- - [2.2.2] Revert back to ```mingo@6.5.1``` because of bugs in ```skip``` operation
382
- - [2.2.3] Bug fix in driver's ```sanitizeBody()```
389
+ - [2.2.2] Revert back to `mingo@6.5.1` because of bugs in `skip` operation
390
+ - [2.2.3] Bug fix in driver's `sanitizeBody()`
383
391
 
384
392
  ## 2026-01-16
385
393
 
@@ -388,24 +396,24 @@
388
396
  ## 2026-01-11
389
397
 
390
398
  - [2.2.0] Any driver that support memory DB can now declare itself as in-memory DB and be handled as such
391
- - [2.2.0] ```driver.init()``` is removed, and driver should solely use ```driver.createClient()``` instead
399
+ - [2.2.0] `driver.init()` is removed, and driver should solely use `driver.createClient()` instead
392
400
  - [2.2.0] Bug fixes
393
401
 
394
402
  ## 2026-01-07
395
403
 
396
- - [2.2.0] Add ```immutable``` feature
404
+ - [2.2.0] Add `immutable` feature
397
405
  - [2.2.0] Lots of bug fixes
398
406
 
399
407
  ## 2025-12-28
400
408
 
401
- - [2.2.0] Add ```calcAggregate()``` & ```calcHistogram()``` for array of data objects
402
- - [2.2.0] Implement ```createAggregate()``` & ```createHistogram()``` to the built-in memory database driver
403
- - [2.2.0] If no ```default``` connection found, all models automatically bound to ```memory``` connection
409
+ - [2.2.0] Add `calcAggregate()` & `calcHistogram()` for array of data objects
410
+ - [2.2.0] Implement `createAggregate()` & `createHistogram()` to the built-in memory database driver
411
+ - [2.2.0] If no `default` connection found, all models automatically bound to `memory` connection
404
412
 
405
413
  ## 2025-12-22
406
414
 
407
415
  - [2.2.0] Introduce Action class that enables you to work on models with chainable methods
408
- - [2.2.0] All base class definitions moved now to ```this.baseClass``` instead of ```this.lib```
416
+ - [2.2.0] All base class definitions moved now to `this.baseClass` instead of `this.lib`
409
417
 
410
418
  ## 2025-12-16
411
419
 
@@ -420,12 +428,12 @@
420
428
  - [2.2.0] Rewrite the whole thing into class based modules: Connection, driver, Feature, Model. Dobo will solely serve as DB Manager in the future
421
429
 
422
430
  ## 2025-12-05
423
- - [2.2.0] Connection now saved in ```this.connections``` as ```Connection``` instance
431
+ - [2.2.0] Connection now saved in `this.connections` as `Connection` instance
424
432
 
425
433
  ## 2025-12-03
426
434
 
427
435
  - [2.1.0] Upgrade joi to 18.0.2
428
436
  - [2.1.0] Upgrade mingo to 7.0.2
429
- - [2.1.0] Feature now saved in ```this.features``` as ```Feature``` instance
430
- - [2.1.0] driver now saved in ```this.drivers``` as ```driver``` instance
431
- - [2.1.0] Add ```this.getdriver()```. Accept short name or NsPath format
437
+ - [2.1.0] Feature now saved in `this.features` as `Feature` instance
438
+ - [2.1.0] driver now saved in `this.drivers` as `driver` instance
439
+ - [2.1.0] Add `this.getdriver()`. Accept short name or NsPath format