1
0
Fork 0

Some tweaks to the Foxx.Repository documentation

This commit is contained in:
Lucas Dohmen 2014-06-18 16:01:06 +02:00
parent e83d05d3b2
commit 96866a0d9f
1 changed files with 16 additions and 39 deletions

View File

@ -34,11 +34,7 @@ var Repository,
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_initializer /// @startDocuBlock JSF_foxx_repository_initializer
/// Create a new instance of Repository /// Create a new instance of Repository with `new FoxxRepository(collection, opts)`
///
/// `new FoxxRepository(collection, opts)`
///
/// Create a new instance of Repository
/// ///
/// A Foxx Repository is always initialized with a collection object. You can get /// A Foxx Repository is always initialized with a collection object. You can get
/// your collection object by asking your Foxx.Controller for it: the /// your collection object by asking your Foxx.Controller for it: the
@ -108,9 +104,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_save /// @startDocuBlock JSF_foxx_repository_save
/// `save(model)` /// Save a model into the database with `save(model)`
///
/// Save a model into the database
/// ///
/// Expects a model. Will set the ID and Rev on the model. /// Expects a model. Will set the ID and Rev on the model.
/// Returns the model. /// Returns the model.
@ -135,9 +129,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_byId /// @startDocuBlock JSF_foxx_repository_byId
/// `byId(id)` /// Find a model by its ID with `byId(id)`
///
/// Find a model by its ID
/// ///
/// Returns the model for the given ID. /// Returns the model for the given ID.
/// ///
@ -157,9 +149,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_byExample /// @startDocuBlock JSF_foxx_repository_byExample
/// `byExample(example)` /// Find all models by an example with `byExample(example)`
///
/// Find all models by an example
/// ///
/// Returns an array of models for the given ID. /// Returns an array of models for the given ID.
/// ///
@ -181,9 +171,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_firstExample /// @startDocuBlock JSF_foxx_repository_firstExample
/// `firstExample(example)` /// Find the first model that matches the example with `firstExample(example)`
///
/// Find the first model that matches the example.
/// ///
/// Returns a model that matches the given example. /// Returns a model that matches the given example.
/// ///
@ -203,7 +191,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_all /// @startDocuBlock JSF_foxx_repository_all
/// `all()` /// Find all entries in the collection with `all()`
/// ///
/// Returns an array of models that matches the given example. You need to provide /// Returns an array of models that matches the given example. You need to provide
/// both a skip and a limit value. /// both a skip and a limit value.
@ -232,9 +220,8 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_remove /// @startDocuBlock JSF_foxx_repository_remove
/// `remove(model)` /// Remove the model from the repository with `remove(model)`
/// ///
/// Remove the model from the repository
/// ///
/// Expects a model /// Expects a model
/// ///
@ -253,9 +240,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_removeById /// @startDocuBlock JSF_foxx_repository_removeById
/// `removeById(id)` /// Remove the document with the given ID with `removeById(id)`
///
/// Remove the document with the given ID
/// ///
/// Expects an ID of an existing document. /// Expects an ID of an existing document.
/// ///
@ -273,9 +258,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_removeByExample /// @startDocuBlock JSF_foxx_repository_removeByExample
/// `removeByExample(example)` /// Remove all documents that match the example with `removeByExample(example)`
///
/// Remove all documents that match the example
/// ///
/// Find all documents that fit this example and remove them. /// Find all documents that fit this example and remove them.
/// ///
@ -297,7 +280,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_replace /// @startDocuBlock JSF_foxx_repository_replace
/// `replace(model)` /// Replace an entry in the collection with its new version via `replace(model)`
/// ///
/// Find the model in the database by its `_id` and replace it with this version. /// Find the model in the database by its `_id` and replace it with this version.
/// Expects a model. Sets the Revision of the model. /// Expects a model. Sets the Revision of the model.
@ -322,9 +305,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_replaceById /// @startDocuBlock JSF_foxx_repository_replaceById
/// `replaceById(id, model)` /// Find an item by ID and replace it with the given model with `replaceById(id, model)`
///
/// Find an item by ID and replace it with the given model
/// ///
/// Find the model in the database by the given ID and replace it with the given. /// Find the model in the database by the given ID and replace it with the given.
/// model. /// model.
@ -347,9 +328,7 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_replaceByExample /// @startDocuBlock JSF_foxx_repository_replaceByExample
/// `replaceByExample(example, model)` /// Find an item by example and replace it with the given model with `replaceByExample(example, model)`
///
/// Find an item by example and replace it with the given model
/// ///
/// Find the model in the database by the given example and replace it with the given. /// Find the model in the database by the given example and replace it with the given.
/// model. /// model.
@ -376,9 +355,8 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_updateById /// @startDocuBlock JSF_foxx_repository_updateById
/// `updateById(id, object)` /// Find an item by ID and update it with the attributes in the provided object with `updateById(id, object)`
/// ///
/// Find an item by ID and update it with the attributes in the provided object.
/// Returns the updated model. /// Returns the updated model.
/// ///
/// *Examples* /// *Examples*
@ -395,9 +373,9 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_updateByExample /// @startDocuBlock JSF_foxx_repository_updateByExample
/// `updateByExample(example, object)` /// Find an item by example and update it with the attributes in the provided object
/// with `updateByExample(example, object)`
/// ///
/// Find an item by example and update it with the attributes in the provided object.
/// Returns the updated model. /// Returns the updated model.
/// ///
/// *Examples* /// *Examples*
@ -418,9 +396,8 @@ _.extend(Repository.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_foxx_repository_count /// @startDocuBlock JSF_foxx_repository_count
/// `count()` /// Return the number of entries in this collection with `count()`
/// ///
/// Return the number of entries in this collection
/// ///
/// *Examples* /// *Examples*
/// ///