query as Promise?

25 views
Skip to first unread message

Kevin Burton

unread,
Dec 30, 2015, 8:57:31 AM12/30/15
to Node-Neo4j
I have code

db.query("CREATE (n:AutoFileRule {props}) RETURN n", params, function(err, results) {

I would like to convert it to more of a promise than a callback. Is this supported? Can I do something like:

db.query("CREATE (n:AutoFileRule {props}) RETURN n", params).then(function(results) {
. . . .
}).catch(function(err) {
 
return err;
});



Thank you.


Aseem Kishore

unread,
Dec 30, 2015, 10:09:33 AM12/30/15
to Kevin Burton, Node-Neo4j
Hi Kevin,

Take a look at this issue for pointers on different approaches to do this:


Cheers,
Aseem


Reply all
Reply to author
Forward
0 new messages