summaryrefslogtreecommitdiff
path: root/app/node_modules/okdb/index.js
diff options
context:
space:
mode:
authorjulie lala <jules@okfoc.us>2015-04-13 16:45:41 -0400
committerjulie lala <jules@okfoc.us>2015-04-13 16:45:41 -0400
commitc702d76549ead663daed0147f5c160c368a61c45 (patch)
treecad22d834c0acd4c871a8bdaa148d1f1f19caf34 /app/node_modules/okdb/index.js
parentedcc3c497f05e14bdd5655a0bc154cee04784a60 (diff)
parentebb17679c64723dc1378079f9da0697673b21f5d (diff)
Merge branch 'twohustlers' of github.com:okfocus/okcms into twohustlers
Diffstat (limited to 'app/node_modules/okdb/index.js')
-rw-r--r--app/node_modules/okdb/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/node_modules/okdb/index.js b/app/node_modules/okdb/index.js
index 85156d1..5aa22a2 100644
--- a/app/node_modules/okdb/index.js
+++ b/app/node_modules/okdb/index.js
@@ -180,7 +180,7 @@ FSDB.prototype.getMeta = function() {
*/
function autoincrement(wrapper, schema, data) {
return schema.autoIncrementFields.reduce(function(data, field) {
- var last = wrapper.chain().sort(field).first().value();
+ var last = wrapper.chain().sortByOrder([field], [true]).last().value();
var index = last ? last[field] : -1;
var incremented = {};
incremented[field] = (parseInt(index) + 1);