Skip to content

Commit a1cd981

Browse files
committed
Implement code review changes
1 parent b6806e9 commit a1cd981

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Adapters/Storage/Mongo/MongoSchemaCollection.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import MongoCollection from './MongoCollection';
22
import Parse from 'parse/node';
3+
import _ from 'lodash'
34

45
function mongoFieldToParseSchemaField(type) {
56
if (type[0] === '*') {
@@ -276,8 +277,9 @@ class MongoSchemaCollection {
276277
}
277278

278279
async updateFieldOptions(className: string, fieldName: string, fieldType: any) {
279-
// eslint-disable-next-line no-unused-vars
280-
const { type, targetClass, ...fieldOptions } = fieldType;
280+
const fieldOptions = _.cloneDeep(fieldType);
281+
delete fieldOptions.type
282+
delete fieldOptions.targetClass
281283
await this.upsertSchema(
282284
className,
283285
{ [fieldName]: { $exists: true } },

0 commit comments

Comments
 (0)