Comparing version 0.3.4 to 0.3.5
12
index.js
@@ -236,3 +236,13 @@ // Dependencies | ||
// Stream the array to the client | ||
// If `count` is set, return the number of documents the query matches | ||
if (request.query.count === true) { | ||
query.count(function (error, count) { | ||
if (error) return next(error); | ||
response.json(count); | ||
}); | ||
return; | ||
} | ||
// Otherwise, stream the array to the client | ||
response.set('Content-Type', 'application/json'); | ||
@@ -239,0 +249,0 @@ response.write('['); |
{ | ||
"name": "baucis", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
baucis v0.3.4 | ||
baucis v0.3.5 | ||
============= | ||
@@ -152,2 +152,4 @@ | ||
It is not permitted to use the `select` option of `populate` with a `+path`. This allows you to deselect paths at the schema level using `select: false` in the path definition. The client will not be able to select paths deselected in this way, but your server middleware may select these fields as usual using `query.select`. | ||
See the Mongoose [population documentation](http://mongoosejs.com/docs/populate.html) for more information. | ||
@@ -203,2 +205,3 @@ | ||
publish: false, // don't add API routes automatically | ||
select: 'foo +bar -password' // select fields for all queries | ||
restrict: function (query, request) { | ||
@@ -205,0 +208,0 @@ // Only retrieve bars that are children of the given foo |
273000
1094
249