Make the identation consistent for now

This commit is contained in:
Raymond Feng 2013-12-16 08:40:06 -08:00
parent aeecfa5551
commit 3d9061aa69
1 changed files with 30 additions and 30 deletions

View File

@ -383,51 +383,51 @@ DataAccessObject._coerce = function (where) {
return new OrigDate(arg);
};
} else if (DataType === Boolean) {
DataType = function(val) {
if(val === 'true') {
return true;
} else if(val === 'false') {
return false;
} else {
return Boolean(val);
}
};
DataType = function(val) {
if(val === 'true') {
return true;
} else if(val === 'false') {
return false;
} else {
return Boolean(val);
}
};
} else if(DataType === Number) {
// This fixes a regression in mongodb connector
// For numbers, only convert it produces a valid number
// LoopBack by default injects a number id. We should fix it based
// on the connector's input, for example, mongoddb should use string
// while RDBs typically use number
DataType = function(val) {
var num = Number(val);
return !isNaN(num) ? num : val;
};
// This fixes a regression in mongodb connector
// For numbers, only convert it produces a valid number
// LoopBack by default injects a number id. We should fix it based
// on the connector's input, for example, MongoDB should use string
// while RDBs typically use number
DataType = function(val) {
var num = Number(val);
return !isNaN(num) ? num : val;
};
}
if (!DataType) {
continue;
if (!DataType) {
continue;
}
if (DataType === geo.GeoPoint) {
// Skip the GeoPoint as the near operator breaks the assumption that
// an operation has only one property
// We should probably fix it based on
// http://docs.mongodb.org/manual/reference/operator/query/near/
// The other option is to make operators start with $
continue;
// Skip the GeoPoint as the near operator breaks the assumption that
// an operation has only one property
// We should probably fix it based on
// http://docs.mongodb.org/manual/reference/operator/query/near/
// The other option is to make operators start with $
continue;
}
var val = where[p];
if(val === null || val === undefined) {
continue;
continue;
}
// Check there is an operator
var operator = null;
if ('object' === typeof val) {
if (Object.keys(val).length !== 1) {
// Skip if there are not only one properties
// as the assumption for operators is not true here
continue;
// Skip if there are not only one properties
// as the assumption for operators is not true here
continue;
}
for (var op in operators) {
if (op in val) {