From 68e4464c59749857bff04ea24834c690c94e01f3 Mon Sep 17 00:00:00 2001 From: Ritchie Martori Date: Fri, 21 Jun 2013 14:59:30 -0700 Subject: [PATCH] Update create api docs --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 022f755a..f56c22fb 100644 --- a/README.md +++ b/README.md @@ -162,13 +162,15 @@ Mixins are added by attaching a vanilla model to a data source with a connector. #### Static Methods -##### Model.create([data], [callback]) +##### Model.create(data, [callback]) -Create an instance of Model with given data and save to the attached data source. +Create an instance of Model with given data and save to the attached data source. Callback is optional. User.create({first: 'Joe', last: 'Bob'}, function(err, user) { console.log(user instanceof User); // true }); + +**Note:** You must include a callback and use the created model provided in the callback if your code depends on your model being saved or having an `id`. ##### Model.count([query], callback)