From 66321df3e7874c4685a4e3c7fd567b073f2522ac Mon Sep 17 00:00:00 2001 From: abhinav anshul Date: Mon, 8 Apr 2019 00:47:35 +0530 Subject: [PATCH] Update index.js --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 03c087d..d1807e5 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ const Customer = require('./models/customer'); const addCustomer = (customer) => { Customer.create(customer).then(customer => { console.info('New Customer Added'); - db.close(); + mongoose.connection.close(); }); } @@ -26,7 +26,7 @@ const findCustomer = (name) => { .then(customer => { console.info(customer); console.info(`${customer.length} matches`); - db.close(); + mongoose.connection.close(); }); }