From 1bdd8aa09fa0bfd6a880d91a6ed38b99e7a1dec7 Mon Sep 17 00:00:00 2001 From: Matulis Date: Wed, 23 Jul 2014 15:32:18 -0500 Subject: [PATCH] Updated insert callback in save function jugglingDB expects a doc with _rev key --- lib/nano.js | 2 +- src/nano.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nano.js b/lib/nano.js index 99dea12..07f5899 100644 --- a/lib/nano.js +++ b/lib/nano.js @@ -102,7 +102,7 @@ } helpers.undoPrep(data); data._rev = doc.rev; - return callback(null, doc.id, doc.rev); + return callback(null, doc.id, doc); }); }; diff --git a/src/nano.coffee b/src/nano.coffee index 3407fac..dc300b8 100644 --- a/src/nano.coffee +++ b/src/nano.coffee @@ -61,7 +61,7 @@ class NanoAdapter data._rev = doc.rev # This callback makes no sense in the context of JugglingDb invocation # but I'm leaving it as-is for other possible use cases. - callback null, doc.id, doc.rev #doc.id, doc.rev + callback null, doc.id, doc #doc.id, doc.rev updateOrCreate: (model, data = {}, callback) => @exists model, data.id, (err, exists) =>