Permalink
Browse files

Bugfix, fixes issue #3 wrt query string

  • Loading branch information...
1 parent 062561f commit f8dcf4f0e6f5de99fe32b4d8274279a13e941783 @tdegrunt committed Oct 8, 2010
Showing with 4 additions and 3 deletions.
  1. +2 −1 .gitignore
  2. +2 −2 lib/rest.js
View
@@ -1 +1,2 @@
-mongodb-rest.esproj
+.DS_Store
+.*.swp
View
@@ -15,7 +15,7 @@ var mongo = require("mongodb"),
* Query
*/
app.get('/:db/:collection/:id?', function(req, res) {
- var query = req.params.query || {};
+ var query = JSON.parse(req.query.query) || {};
// Providing an id overwrites giving a query in the URL
if (req.params.id) {
@@ -109,4 +109,4 @@ app.del('/:db/:collection/:id', function(req, res) {
});
});
});
-});
+});

0 comments on commit f8dcf4f

Please sign in to comment.