code: function(name, doc, fromMessage, res) {
              var id   = this.toId(doc._id, true);
              if (typeof id === 'undefined' || id === '') {
                  return res.send(400, "invalid id.");
              }
              doc._id  = id;
              doc._time = new Date().getTime();
  
              var collection = new mongodb.Collection(this.db, name);
              collection.insert(
                  doc,
                  {safe:true},
                  function(err, docs) {
                      if(err) {
                          res.send(400, err);
                      } else {
                          var doc = docs && docs.length > 0 ? docs[0] : null;
                          if (doc) {
                              var msg = {
                                  method: 'create',
                                  id: doc._id,
                                  time: doc._time,
                                  data: doc
                              };
                              rest.onSuccess(name, msg, fromMessage);
                              res.send(doc);
                          } else {
                              res.send(400, 'failed to create document.');
                          }
                      }
                  }
              );
          }
docs: Create new document(s)