diff --git a/lib/dao.js b/lib/dao.js index 0e9e7c6f..e93a58e9 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -194,7 +194,7 @@ function setRemoting(fn, options) { } setRemoting(DataAccessObject.create, { - description: 'Create new instance of the model and save it in database', + description: 'Create a new instance of the model and persist it into the data source', accepts: {arg: 'data', type: 'object', http: {source: 'body'}}, returns: {arg: 'data', type: 'object', root: true}, http: {verb: 'post', path: '/'} @@ -251,7 +251,7 @@ DataAccessObject.upsert = DataAccessObject.updateOrCreate = function upsert(data // upsert ~ remoting attributes setRemoting(DataAccessObject.upsert, { - description: 'Update or insert a model instance', + description: 'Update an existing model instance or insert a new one into the data source', accepts: {arg: 'data', type: 'object', http: {source: 'body'}}, returns: {arg: 'data', type: 'object', root: true}, http: {verb: 'put', path: '/'} @@ -304,7 +304,7 @@ DataAccessObject.exists = function exists(id, cb) { // exists ~ remoting attributes setRemoting(DataAccessObject.exists, { - description: 'Check whether a model instance exists in database', + description: 'Check whether a model instance exists in the data source', accepts: {arg: 'id', type: 'any'}, returns: {arg: 'exists', type: 'any'}, http: {verb: 'get', path: '/exists'} @@ -334,7 +334,7 @@ DataAccessObject.findById = function find(id, cb) { // find ~ remoting attributes setRemoting(DataAccessObject.findById, { - description: 'Find a model instance by id', + description: 'Find a model instance by id from the data source', accepts: {arg: 'id', type: 'any'}, returns: {arg: 'data', type: 'any', root: true}, http: {verb: 'get', path: '/:id'} @@ -449,7 +449,7 @@ DataAccessObject.find = function find(params, cb) { // all ~ remoting attributes setRemoting(DataAccessObject.find, { - description: 'Find all instances of the model, matched by the filter', + description: 'Find all instances of the model by filter from the data source', accepts: {arg: 'filter', type: 'object'}, returns: {arg: 'data', type: 'array', root: true}, http: {verb: 'get', path: '/'} @@ -476,7 +476,7 @@ DataAccessObject.findOne = function findOne(params, cb) { }; setRemoting(DataAccessObject.findOne, { - description: 'Find first instance of the model, matched by the filter', + description: 'Find first instance of the model by filter from the data source', accepts: {arg: 'filter', type: 'object'}, returns: {arg: 'data', type: 'object', root: true}, http: {verb: 'get', path: '/findOne'} @@ -528,7 +528,7 @@ DataAccessObject.deleteById = // deleteById ~ remoting attributes setRemoting(DataAccessObject.deleteById, { - description: 'Delete a model instance by id', + description: 'Delete a model instance by id from the data source', accepts: {arg: 'id', type: 'any'}, http: {verb: 'del', path: '/:id'} }); @@ -553,7 +553,7 @@ DataAccessObject.count = function (where, cb) { // count ~ remoting attributes setRemoting(DataAccessObject.count, { - description: 'Count instances of the model, matched by the where condition', + description: 'Count instances of the model by the where condition', accepts: {arg: 'where', type: 'object'}, returns: {arg: 'count', type: 'number'}, http: {verb: 'get', path: '/count'} @@ -746,7 +746,7 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, cb // updateAttributes ~ remoting attributes setRemoting(DataAccessObject.prototype.updateAttributes, { - description: 'Update set of attributes for a model instance', + description: 'Update attributes for a model instance and persist it into the data source', accepts: {arg: 'data', type: 'object', http: {source: 'body'}}, returns: {arg: 'data', type: 'object', root: true}, http: {verb: 'put', path: '/'} @@ -766,7 +766,7 @@ DataAccessObject.prototype.reload = function reload(callback) { }; setRemoting(DataAccessObject.prototype.reload, { - description: 'Reload a model instance from database', + description: 'Reload a model instance from the data source', returns: {arg: 'data', type: 'object', root: true} });