Remove mongo object create format from Parse Server (#1516)

This commit is contained in:
Drew
2016-04-18 09:45:48 -07:00
committed by Florent Vilmart
parent c57c6b33b1
commit ac839f75c7
4 changed files with 24 additions and 21 deletions

View File

@@ -3,8 +3,6 @@ import _ from 'lodash';
var mongodb = require('mongodb');
var Parse = require('parse/node').Parse;
// TODO: Turn this into a helper library for the database adapter.
// Transforms a key-value pair from REST API form to Mongo form.
// This is the main entry point for converting anything from REST form
// to Mongo form; no conversion should happen that doesn't pass
@@ -203,7 +201,7 @@ function transformWhere(schema, className, restWhere, options = {validate: true}
// Main exposed method to create new objects.
// restCreate is the "create" clause in REST API form.
// Returns the mongo form of the object.
function transformCreate(schema, className, restCreate) {
function parseObjectToMongoObject(schema, className, restCreate) {
if (className == '_User') {
restCreate = transformAuthData(restCreate);
}
@@ -940,7 +938,7 @@ var FileCoder = {
module.exports = {
transformKey,
transformCreate,
parseObjectToMongoObject,
transformUpdate,
transformWhere,
transformSelect,