@toa.io/storages.mongodb 1.0.0-alpha.173 → 1.0.0-alpha.179

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/storage.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/storages.mongodb",
3
- "version": "1.0.0-alpha.173",
3
+ "version": "1.0.0-alpha.179",
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",
@@ -27,5 +27,5 @@
27
27
  "openspan": "1.0.0-alpha.173",
28
28
  "saslprep": "1.0.3"
29
29
  },
30
- "gitHead": "2d40a918fec3cedd4c759fbed037c5104d2e4cbc"
30
+ "gitHead": "acd6f3df8542e85a1c95b68a5d53c5909fece886"
31
31
  }
package/src/storage.js CHANGED
@@ -253,8 +253,8 @@ class Storage extends Connector {
253
253
  getOptional (fields) {
254
254
  const optional = []
255
255
 
256
- for (const field of fields) {
257
- if (!(field in this.#entity.schema.properties))
256
+ for (const field of fields) {
257
+ if (!field.includes('.') && !(field in this.#entity.schema.properties))
258
258
  throw new Error(`Index field '${field}' is not defined.`)
259
259
 
260
260
  if (!this.#entity.schema.required?.includes(field))