We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6806e9 commit a1cd981Copy full SHA for a1cd981
src/Adapters/Storage/Mongo/MongoSchemaCollection.js
@@ -1,5 +1,6 @@
1
import MongoCollection from './MongoCollection';
2
import Parse from 'parse/node';
3
+import _ from 'lodash'
4
5
function mongoFieldToParseSchemaField(type) {
6
if (type[0] === '*') {
@@ -276,8 +277,9 @@ class MongoSchemaCollection {
276
277
}
278
279
async updateFieldOptions(className: string, fieldName: string, fieldType: any) {
- // eslint-disable-next-line no-unused-vars
280
- const { type, targetClass, ...fieldOptions } = fieldType;
+ const fieldOptions = _.cloneDeep(fieldType);
281
+ delete fieldOptions.type
282
+ delete fieldOptions.targetClass
283
await this.upsertSchema(
284
className,
285
{ [fieldName]: { $exists: true } },
0 commit comments