@@ -43,13 +43,13 @@ var defaultColumns = {
43
43
"GCMSenderId" : { type :'String' } ,
44
44
"timeZone" : { type :'String' } ,
45
45
"localeIdentifier" : { type :'String' } ,
46
- "badge" : { type :'Number' } ,
46
+ "badge" : { type :'Number' }
47
47
} ,
48
48
// The additional default columns for the _User collection (in addition to DefaultCols)
49
49
_Role : {
50
50
"name" : { type :'String' } ,
51
51
"users" : { type :'Relation' , className :'_User' } ,
52
- "roles" : { type :'Relation' , className :'_Role' } ,
52
+ "roles" : { type :'Relation' , className :'_Role' }
53
53
} ,
54
54
// The additional default columns for the _User collection (in addition to DefaultCols)
55
55
_Session : {
@@ -58,9 +58,9 @@ var defaultColumns = {
58
58
"installationId" : { type :'String' } ,
59
59
"sessionToken" : { type :'String' } ,
60
60
"expiresAt" : { type :'Date' } ,
61
- "createdWith" : { type :'Object' } ,
62
- } ,
63
- }
61
+ "createdWith" : { type :'Object' }
62
+ }
63
+ } ;
64
64
65
65
// Valid classes must:
66
66
// Be one of _User, _Installation, _Role, _Session OR
@@ -221,7 +221,7 @@ Schema.prototype.addClassIfNotExists = function(className, fields) {
221
221
error : invalidClassNameMessage ( className ) ,
222
222
} ) ;
223
223
}
224
- for ( fieldName in fields ) {
224
+ for ( var fieldName in fields ) {
225
225
if ( ! fieldNameIsValid ( fieldName ) ) {
226
226
return Promise . reject ( {
227
227
code : Parse . Error . INVALID_KEY_NAME ,
@@ -240,26 +240,25 @@ Schema.prototype.addClassIfNotExists = function(className, fields) {
240
240
_id : className ,
241
241
objectId : 'string' ,
242
242
updatedAt : 'string' ,
243
- createdAt : 'string' ,
243
+ createdAt : 'string'
244
244
} ;
245
- for ( fieldName in defaultColumns [ className ] ) {
246
- validatedField = schemaAPITypeToMongoFieldType ( defaultColumns [ className ] [ fieldName ] ) ;
245
+ for ( var fieldName in defaultColumns [ className ] ) {
246
+ var validatedField = schemaAPITypeToMongoFieldType ( defaultColumns [ className ] [ fieldName ] ) ;
247
247
if ( validatedField . code ) {
248
248
return Promise . reject ( validatedField ) ;
249
249
}
250
250
mongoObject [ fieldName ] = validatedField . result ;
251
251
}
252
252
253
- for ( fieldName in fields ) {
254
- validatedField = schemaAPITypeToMongoFieldType ( fields [ fieldName ] ) ;
253
+ for ( var fieldName in fields ) {
254
+ var validatedField = schemaAPITypeToMongoFieldType ( fields [ fieldName ] ) ;
255
255
if ( validatedField . code ) {
256
256
return Promise . reject ( validatedField ) ;
257
257
}
258
258
mongoObject [ fieldName ] = validatedField . result ;
259
259
}
260
260
261
261
var geoPoints = Object . keys ( mongoObject ) . filter ( key => mongoObject [ key ] === 'geopoint' ) ;
262
-
263
262
if ( geoPoints . length > 1 ) {
264
263
return Promise . reject ( {
265
264
code : Parse . Error . INCORRECT_TYPE ,
@@ -278,7 +277,7 @@ Schema.prototype.addClassIfNotExists = function(className, fields) {
278
277
}
279
278
return Promise . reject ( error ) ;
280
279
} ) ;
281
- }
280
+ } ;
282
281
283
282
// Returns a promise that resolves successfully to the new schema
284
283
// object or fails with a reason.
0 commit comments