diff options
Diffstat (limited to 'app/node_modules/okdb/index.js')
| -rw-r--r-- | app/node_modules/okdb/index.js | 2 |
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); |
