You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: WIndows 10 (Version 1709 (OS Build 16299.192))
Scope (install, code, runtime, meta, other?):
Module (and version) (if relevant):
# I'm following Academind's playlist on creating Node.js Shopping Cart and in the Video #4 "Seeding Data" I've created the models for it and then trying to create product-seeder.js file as follows:
var Product = require('../models/product');
var mongoose = require('mongoose');
mongoose.connect('localhost:27017/shopping');
var products = [
new Product({
imagePath: 'https://upload.wikimedia.org/wikipedia/en/5/5e/Gothiccover.png',
title: 'Gothic Video Game',
description: 'Awesome Game!!!',
price: 10
}),
new Product({
and it's details
}),
];
var done = 0;
for (var i = 0; i < products.length; i++) {
products[i].save();
done++;
if(done === products.length){
exit();
}
}
function exit(){
mongoose.disconnect();
};
error regarding the mongodb server
(node:2316) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: URI does not have hostname, domain name and tld
(node:2316) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
# I'm following Academind's playlist on creating Node.js Shopping Cart and in the Video #4 "Seeding Data" I've created the models for it and then trying to create product-seeder.js file as follows:
error regarding the mongodb server
my package.json has these modules:
The text was updated successfully, but these errors were encountered: