@researchdatabox/sails-hook-redbox-storage-mongo 1.4.8 → 1.4.9
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
|
@@ -153,6 +153,12 @@ export module Services {
|
|
|
153
153
|
_.unset(record, 'dateCreated');
|
|
154
154
|
_.unset(record, 'lastSaveDate');
|
|
155
155
|
_.unset(record, '_id');
|
|
156
|
+
|
|
157
|
+
// Records with an 'id' property fail to save with error:
|
|
158
|
+
// {"cause":{"name":"AdapterError","adapterMethodName":"update","modelIdentity":"record","raw":{"code":"E_CANNOT_INTERPRET_AS_OBJECTID"}},"isOperational":true}
|
|
159
|
+
// Fix by ensuring the 'id' property is removed.
|
|
160
|
+
_.unset(record, 'id');
|
|
161
|
+
|
|
156
162
|
await Record.updateOne({ redboxOid: oid }).set(record);
|
|
157
163
|
response.success = true;
|
|
158
164
|
} catch (err) {
|