From a30d7307e555d0dbc71d4e5ef196379703709d64 Mon Sep 17 00:00:00 2001 From: "gabriele.lana" Date: Fri, 12 Dec 2014 15:56:04 +0100 Subject: [PATCH] Release 0.2.6 --- package.json | 2 +- released/mongorc.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 617f2f4..6b13800 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mongodb-shell-extensions", - "version": "0.2.5", + "version": "0.2.6", "description": "Useful MongoDB shell extensions", "files": [ "src", diff --git a/released/mongorc.js b/released/mongorc.js index 878d5d2..0eec45b 100644 --- a/released/mongorc.js +++ b/released/mongorc.js @@ -10244,7 +10244,7 @@ moment.fn.within = function(range) { /* global chatty */ -chatty('\033[1;32m+ MongoDB Shell Extensions (0.2.5) by Gabriele Lana \033[0m') +chatty('\033[1;32m+ MongoDB Shell Extensions (0.2.6) by Gabriele Lana \033[0m') DBCollection.prototype.last = function(n) { return this.find().sort({_id: -1}).limit(n || 1) @@ -10352,11 +10352,9 @@ var tocsv = (function() { })() DBQuery.prototype.reverse = function() { - if (!this._query.query || _.isEmpty(this._query.query)) { - this._query.query = {} - } + this._checkModify(); if (!this._query.orderby || _.isEmpty(this._query.orderby)) { - this._query.orderby = {'$natural': 1} + this._addSpecial('orderby', {'$natural': 1}); } for (var field in this._query.orderby) { this._query.orderby[field] = this._query.orderby[field] * -1