summaryrefslogtreecommitdiff
path: root/app/node_modules/okdb/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-04-13 16:46:04 -0400
committerJules Laplace <jules@okfoc.us>2015-04-13 16:46:04 -0400
commit3e255208a9776ad377f3b62d79d982138e89539a (patch)
tree45ed64ad10ea19eabf1a57b8a8b4d42ee6111e13 /app/node_modules/okdb/index.js
parente791ea8b3d6855b62962e4c89ad2c9f86126daf1 (diff)
parentc702d76549ead663daed0147f5c160c368a61c45 (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);