Skip to content

Adding products in database causing issue. #4

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions