Skip to content

Commit

Permalink
Release 0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielelana committed Dec 17, 2014
1 parent 9de8d24 commit 0750fa0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb-shell-extensions",
"version": "0.2.6",
"version": "0.2.7",
"description": "Useful MongoDB shell extensions",
"files": [
"src",
Expand Down
11 changes: 10 additions & 1 deletion released/mongorc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10244,7 +10244,7 @@ moment.fn.within = function(range) {

/* global chatty */

chatty('\033[1;32m+ MongoDB Shell Extensions (0.2.6) by Gabriele Lana <[email protected]>\033[0m')
chatty('\033[1;32m+ MongoDB Shell Extensions (0.2.7) by Gabriele Lana <[email protected]>\033[0m')

DBCollection.prototype.last = function(n) {
return this.find().sort({_id: -1}).limit(n || 1)
Expand Down Expand Up @@ -10404,6 +10404,12 @@ DBCollection.prototype.distinctAndCount = function(field, query) {
_(r.values)
.chain()
.values()
.map(function(value) {
if (value === null) {
return {valueOf: function() {return value}}
}
return value
})
.any(function(value) {
if (_(value).isArray()) {
return _(value).all(function(value) {
Expand All @@ -10424,6 +10430,9 @@ DBCollection.prototype.distinctAndCount = function(field, query) {
.chain()
.values()
.map(function(value) {
if (value === null) {
return '#null#'
}
if (_(value.valueOf).isFunction()) {
value = value.valueOf()
}
Expand Down

0 comments on commit 0750fa0

Please sign in to comment.