garrensmith commented on a change in pull request #102: Promise support for 
Nano - Issue 98
URL: https://github.com/apache/couchdb-nano/pull/102#discussion_r203309000
 
 

 ##########
 File path: migration_6_to_7.md
 ##########
 @@ -0,0 +1,97 @@
+# Migration Guide for moving from Nano 6.x to 7.x
+
+Version 7.0.0 saw a major switch in return values from the majority of Nano 
functions. The version 6 version of Nano always returned a 
[request](https://www.npmjs.com/package/request) object from any function call 
that made an HTTP/HTTPS request.
+
+
+In Nano 6:
+
+```js
+// Nano 6
+var db = nano.db.use('mydb')
+var x = db.get('mydoc') 
+// x is a request object
+```
+
+In Nano 7:
+
+```js
+// Nano 7
+var db = nano.db.use('mydb')
+var x = db.get('mydoc') 
 
 Review comment:
   You could maybe make this `const x = await db.get('mydoc');` To show its a 
promise and we could use async/await

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to