I have a VERY csmple application. For reasons relates to reactJS rencer cycles I need to store the page name when the user clicks a tile in the Navbar. I have a local MongoDB installation on my Mac ( Catalina ) and I need to know how to specify the database in a reactJS module (require? import? etc) and then how to (in reactJS):
a) count the records in the db (there should only be 0 or 1)
b) add a text field to the first record is the count is 0
v) replace the first record is the count is 1
I do not use Express - there is no html except in the divs exported from each component.
There is a great deal of information on complex usages, but I can find nothing on these simple operations.