Skip to content

Commit

Permalink
You can use find now :)
Browse files Browse the repository at this point in the history
  • Loading branch information
benpickles committed Mar 1, 2011
1 parent f735694 commit b6656b0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/getting_started.md
Expand Up @@ -10,13 +10,16 @@ This allows you to create instances of "project" models and also contains an int

Now you can create and manipulate instances of your new model. Attributes are read and set with the [`attr()`](#attr) method which works in a similar way to jQuery on the DOM.

var project = new Project({ title: "stuff" })
var project = new Project({ id: 1, title: "stuff" })
project.attr("title", "nonsense")
project.save()

### Finding objects

After calling [`save()`](#save) on a model it is added to the class's "collection" and can be retrieved again by calling [`first()`](#first).
After calling [`save()`](#save) on a model it is added to the class's "collection" and can be retrieved again by calling [`find()`](#find) (or [`first()`](#first) as it is the first model in the collection).

Project.find(1)
// => project

Project.first()
// => project
Expand All @@ -26,7 +29,7 @@ You can retrieve all models from the collection with [`all()`](#all).
Project.all()
// => [project]

For more ways to query the collection check out [`find()`](#find), [`detect()`](#detect) and [`select()`](#select).
For more ways to query the collection check out [`detect()`](#detect) and [`select()`](#select).

### Custom properties

Expand Down

0 comments on commit b6656b0

Please sign in to comment.