Skip to content
Browse files

Updated docs to include where method

  • Loading branch information...
1 parent b339b5d commit 5c1e02f1f4fff3c24d2b98ae93e78bdf0f714c0d @davidgtonge committed Feb 13, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1
@@ -21,7 +21,10 @@ You can install with NPM: `npm install backbone-query`
Then simply require in your project: `QueryCollection = require("backbone-query").QueryCollection`
-Your collections will now have a `query` method that can be used like this:
+Your collections will now have two new methods: `query` and `where`. Both methods accept 2 arguments -
+a query object and an options object. The `query` method returns an array of models, but the `where` method
+returns a new collection and is therefore useful where you would like to chain multiple collection
+methods / where queries. The following are some basic examples:
@@ -68,6 +71,17 @@ MyCollection.query
colors: $contains: "yellow"
+Another CoffeeScript example, this time using `where` rather than `query`
+query =
+ $likes: $lt: 10
+ $downloads: $gt: 20
Query API

0 comments on commit 5c1e02f

Please sign in to comment.
Something went wrong with that request. Please try again.