dobo 2.8.0 → 2.8.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.
@@ -159,7 +159,7 @@ async function memoryDriverFactory () {
159
159
  _getCursor (model, filter) {
160
160
  const criteria = filter.query ?? {}
161
161
  const q = new Query(criteria, { idKey: '_id' })
162
- return q.find(this.storage[model.name])
162
+ return q.find(this.storage[model.name] ?? [])
163
163
  }
164
164
  }
165
165
 
@@ -31,14 +31,17 @@ async function native (body = {}, opts = {}) {
31
31
 
32
32
  async function manual (body = {}, options = {}) {
33
33
  const { isSet } = this.app.lib.aneka
34
+ const { get, omit } = this.app.lib._
34
35
  if (isSet(body.id)) body.id = this.sanitizeId(body.id)
35
36
  let old = false
36
37
  if (isSet(body.id)) {
37
38
  try {
38
39
  old = await this.driver._getRecord(this, body.id, { noHook: true, noModelHook: true })
39
- } catch (err) {}
40
+ } catch (err) {
41
+ }
40
42
  }
41
- if (old) return await this.updateRecord(old.data.id, body, options)
43
+ const id = get(old, 'dara.id')
44
+ if (id) return await this.updateRecord(old.data.id, omit(body, ['id']), options)
42
45
  return await this.createRecord(body, options)
43
46
  }
44
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dobo",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "DBMS for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-23
4
+
5
+ - [2.8.1] Bug fix on ```memory._getCursor()```
6
+ - [2.8.1] Bug fix on ```model.upsertRecord()```
7
+
3
8
  ## 2026-02-22
4
9
 
5
10
  - [2.8.0] Add ```warnings``` to response object