You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tracked down what's causing the error. I don't know if this is the only issue, but it allows me to create/read/update documents using a Map field.
Mongoose adds an extra entry to schema.paths for the Map type. It's called 'mapField.$*'. When that's included in the RestHapi queries, it throws the error mentioned above. When I filter out that path from the query, everything seems to work normally.
Describe the bug
When a schema has a Map field, create/read/update operations throw the following server-side error:
To Reproduce
Example schema:
Expected behavior
Map types should be converted to/from plain objects. Joi would validate the shape of the contents of the Map, but not the Map keys themselves.
E.g. Sample JSON using the schema above; the first key/value, "key1", would pass Joi validation. The rest would fail.
This would pass as well:
Desktop (please complete the following information):
Additional info
The DELETE operation still works. I created content directly in the DB, and was able to delete it through the REST endpoint.
The text was updated successfully, but these errors were encountered: