.create( values, [callback] )

Purpose

Creates a new instance of this model in the database.

Overview

Parameters

Description Accepted Data Types Required ?
1 Record(s) to Create {}, [{}] Yes
2 Callback function No

Callback Parameters

Description Possible Data Types
1 Error Error
2 Records Created {}, [{}]

Example Usage

  1. // create a new record with name 'Walter Jr'
  2. User.create({name:'Walter Jr'}).exec(function createCB(err,created){
  3. console.log('Created user with name '+created.name);
  4. });
  5. // Created user with name Walter Jr
  6. // Don't forget to handle your errors and abide by the rules you defined in your model