Browse files

Made JS examples clearer and fixed syntax error

  • Loading branch information...
1 parent 21ed016 commit 3a2f807e23e549d54727da734acbd0768b4ac9ba @davidgtonge committed Feb 8, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 README.md
View
13 README.md
@@ -24,7 +24,10 @@ Then simply require in your project: `QueryCollection = require("backbone-query"
Your collections will now have a `query` method that can be used like this:
```js
-MyCollection.query({ {featured:true}, {likes: $gt:10} });
+MyCollection.query({
+ featured:true,
+ likes: {$gt:10}
+});
// Returns all models where the featured attribute is true and there are
// more than 10 likes
@@ -40,13 +43,15 @@ MyCollection.query({
// Models must match all these queries
$and:{
title: {$like: "news"}, // Title attribute contains the string "news"
- likes: {$gt: 10}}, // Likes attribute is greater than 10
+ likes: {$gt: 10}
+ }, // Likes attribute is greater than 10
// Models must match one of these queries
$or:{
featured: true, // Featured attribute is true
- category:{$in:["code","programming","javascript"]}}
- //Category attribute is either "code", "programming", or "javascript"
+ category:{$in:["code","programming","javascript"]}
+ }
+ //Category attribute is either "code", "programming", or "javascript"
});
```

0 comments on commit 3a2f807

Please sign in to comment.