Class: DBObjectCreateTemplate

DBObjectCreateTemplate


new DBObjectCreateTemplate(name:, data: [, uri] [, options])

Parameters:
Name Type Argument Description
name: String

valid DBObject name

data: Object

data set

uri Object <optional>

{route, method} object if not POST @ '/api/'

options Object <optional>
Properties
Name Type Argument Default Description
returnedProp: String

name of the property which contains the object / objectId

id: boolean

true => returns an ID only; false => return a full object

check: boolean

set to true to check if data from created object match data

compareFn: function

function that takes (key, createdValue, inputValue, isCreatedValueDBObject) and must return true if value1 is equal to value2. Used, if check is set to true, to check if the created object matches the input data (amiwo's smartEqual by default)

exists String <optional>
err

define behavior if such a DBObject already exists => "reuse", "err"

Source: