nodejs-shopping-cart-tutorial icon indicating copy to clipboard operation
nodejs-shopping-cart-tutorial copied to clipboard

Adding products in database causing issue.

Open ghost opened this issue 8 years ago • 0 comments

When I add a new document to the Products collection, it causes this problem in execution

untitled

I found that's about the chunkSize variable in the shopping/routes/index.js file, that variable must contain exactly the number of products saved in the database, so to keep my app executable, I must manually change the value of chunkSize and every single n equal to that variable (also equal to number of documents in Products collection) after insertion of new product(s), or I can count the number of the docs in that collection with a mongoDB count methods, but this issue is also related to pagination which is not covered in the tutorial, so basically, if I solved the issue of the execution error, I will have another problem, for example if I have 1000 products in the database, they will be shown in a single page, which is inconvenient.

ghost avatar Oct 08 '16 16:10 ghost