+ 1

Node.js counting from database question

So my project is made with MERN stack and it has: 1-"src" folder which contains the front end (a form to fill) 2-"server" folder for the server which contains Models declaration and connection to mongo dB So, everything is fine but the problem is that I want to write the code which allows me to know the count of filled forms. I tried to use "countDocuments" but I don't know how to set it on my project because of the different folders I have.

17th Jun 2022, 11:34 AM
TheWitcher
TheWitcher - avatar
1 ответ
0
path_to_form_data_collection.countDocuments() This will return number of documents inside the collection
18th Jun 2022, 4:18 AM
kasundularaam
kasundularaam - avatar