Skip to content

Commit 7dca7e2

Browse files
committed
Remove schemaController parameter
1 parent e440046 commit 7dca7e2

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

spec/MongoTransform.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ describe('transformWhere', () => {
121121
describe('mongoObjectToParseObject', () => {
122122
it('built-in timestamps', (done) => {
123123
var input = {createdAt: new Date(), updatedAt: new Date()};
124-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, { fields: {} });
124+
var output = transform.mongoObjectToParseObject(null, input, { fields: {} });
125125
expect(typeof output.createdAt).toEqual('string');
126126
expect(typeof output.updatedAt).toEqual('string');
127127
done();
128128
});
129129

130130
it('pointer', (done) => {
131131
var input = {_p_userPointer: '_User$123'};
132-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, {
132+
var output = transform.mongoObjectToParseObject(null, input, {
133133
fields: { userPointer: { type: 'Pointer', targetClass: '_User' } },
134134
});
135135
expect(typeof output.userPointer).toEqual('object');
@@ -141,7 +141,7 @@ describe('mongoObjectToParseObject', () => {
141141

142142
it('null pointer', (done) => {
143143
var input = {_p_userPointer: null};
144-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, {
144+
var output = transform.mongoObjectToParseObject(null, input, {
145145
fields: { userPointer: { type: 'Pointer', targetClass: '_User' } },
146146
});
147147
expect(output.userPointer).toBeUndefined();
@@ -150,7 +150,7 @@ describe('mongoObjectToParseObject', () => {
150150

151151
it('file', (done) => {
152152
var input = {picture: 'pic.jpg'};
153-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, {
153+
var output = transform.mongoObjectToParseObject(null, input, {
154154
fields: { picture: { type: 'File' }},
155155
});
156156
expect(typeof output.picture).toEqual('object');
@@ -160,7 +160,7 @@ describe('mongoObjectToParseObject', () => {
160160

161161
it('geopoint', (done) => {
162162
var input = {location: [180, -180]};
163-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, {
163+
var output = transform.mongoObjectToParseObject(null, input, {
164164
fields: { location: { type: 'GeoPoint' }},
165165
});
166166
expect(typeof output.location).toEqual('object');
@@ -172,7 +172,7 @@ describe('mongoObjectToParseObject', () => {
172172

173173
it('nested array', (done) => {
174174
var input = {arr: [{_testKey: 'testValue' }]};
175-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, {
175+
var output = transform.mongoObjectToParseObject(null, input, {
176176
fields: { arr: { type: 'Array' } },
177177
});
178178
expect(Array.isArray(output.arr)).toEqual(true);
@@ -192,7 +192,7 @@ describe('mongoObjectToParseObject', () => {
192192
},
193193
regularKey: "some data",
194194
}]}
195-
let output = transform.mongoObjectToParseObject(dummySchema, null, input, {
195+
let output = transform.mongoObjectToParseObject(null, input, {
196196
fields: { array: { type: 'Array' }},
197197
});
198198
expect(dd(output, input)).toEqual(undefined);
@@ -262,7 +262,7 @@ describe('transform schema key changes', () => {
262262
_rperm: ["*"],
263263
_wperm: ["Kevin"]
264264
};
265-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, { fields: {} });
265+
var output = transform.mongoObjectToParseObject(null, input, { fields: {} });
266266
expect(typeof output.ACL).toEqual('object');
267267
expect(output._rperm).toBeUndefined();
268268
expect(output._wperm).toBeUndefined();
@@ -276,7 +276,7 @@ describe('transform schema key changes', () => {
276276
long: mongodb.Long.fromNumber(Number.MAX_SAFE_INTEGER),
277277
double: new mongodb.Double(Number.MAX_VALUE)
278278
}
279-
var output = transform.mongoObjectToParseObject(dummySchema, null, input, {
279+
var output = transform.mongoObjectToParseObject(null, input, {
280280
fields: {
281281
long: { type: 'Number' },
282282
double: { type: 'Number' },

src/Adapters/Storage/Mongo/MongoStorageAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class MongoStorageAdapter {
202202
find(className, query, { skip, limit, sort }, schemaController, schema) {
203203
return this.adaptiveCollection(className)
204204
.then(collection => collection.find(query, { skip, limit, sort }))
205-
.then(objects => objects.map(object => transform.mongoObjectToParseObject(schemaController, className, object, schema)));
205+
.then(objects => objects.map(object => transform.mongoObjectToParseObject(className, object, schema)));
206206
}
207207

208208
get transform() {

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ const nestedMongoObjectToNestedParseObject = mongoObject => {
755755

756756
// Converts from a mongo-format object to a REST-format object.
757757
// Does not strip out anything based on a lack of authentication.
758-
const mongoObjectToParseObject = (schemaController, className, mongoObject, schema) => {
758+
const mongoObjectToParseObject = (className, mongoObject, schema) => {
759759
switch(typeof mongoObject) {
760760
case 'string':
761761
case 'number':

0 commit comments

Comments
 (0)