   @create : ->
     throw 'this function must be overrided'
 
+  @createModels : (docs)->
+    throw 'docs must be array' if not _.isArray docs
+    results = []
+    if docs.length is 1
+      for doc in docs
+        results.push @create doc
+    else
+      results = @create docs[0]
+    results
   @table : ->
     "#{@name.toLowerCase()}s"
 

    @collection().find(data, opts).toArray (err, docs)=>
      throw err if err
      if callback
        results = []
        if docs.length is 1
          results = @create docs[0]
        else
          for doc in docs
            results.push @create doc
        callback err, results

  @findById: (id, callback) ->

    @collection().insert data, {w:1}, (err, docs) =>
      throw err if err
      if callback
        results = @constructor.createModels docs
        callback err, results

  update : (newObj , opts = {},callback) ->
