@toa.io/storages.mongodb 1.0.0-alpha.143 → 1.0.0-alpha.154

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/storages.mongodb",
3
- "version": "1.0.0-alpha.143",
3
+ "version": "1.0.0-alpha.154",
4
4
  "description": "Toa MongoDB Storage Connector",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -20,12 +20,12 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@toa.io/conveyor": "1.0.0-alpha.93",
23
- "@toa.io/core": "1.0.0-alpha.136",
23
+ "@toa.io/core": "1.0.0-alpha.154",
24
24
  "@toa.io/generic": "1.0.0-alpha.93",
25
25
  "@toa.io/pointer": "1.0.0-alpha.143",
26
26
  "mongodb": "6.7.0",
27
27
  "openspan": "1.0.0-alpha.93",
28
28
  "saslprep": "1.0.3"
29
29
  },
30
- "gitHead": "a98d593cac7077f15ef3d178c35dbb9f5742af47"
30
+ "gitHead": "01832fc47f9906d6a63180d5c2813db86763506a"
31
31
  }
package/src/storage.js CHANGED
@@ -179,7 +179,7 @@ class Storage extends Connector {
179
179
  for (const [suffix, declaration] of Object.entries(this.#entity.index)) {
180
180
  const name = 'index_' + suffix
181
181
  const fields = Object.fromEntries(Object.entries(declaration)
182
- .map(([name, type]) => [name, INDEX_TYPES[type]]))
182
+ .map(([name, type]) => [name, INDEX_TYPES[type] ?? type]))
183
183
 
184
184
  const sparse = this.checkFields(Object.keys(fields))
185
185
 
package/src/translate.js CHANGED
@@ -18,6 +18,9 @@ const translate = (query) => {
18
18
  if (query?.version !== undefined)
19
19
  result.criteria._version = query.version
20
20
 
21
+ if (query?.search !== undefined)
22
+ result.criteria.$text = { $search: query.search }
23
+
21
24
  return result
22
25
  }
23
26