Nodejs uses mongoose to operate mongodb

connecting to the database ok, is sure to be connected, but when manipulating a collection, the collection is not automatically created in the database when the collection does not exist. I remember that the document said that it would be automatically created when it did not exist.

Apr.22,2021

is created, maybe you should save something to try


the collection is automatically created only when the insert operation is performed. New mongoose.Schema ({}) is not really an insert operation yet, it's just defined.


try saving a piece of data? The collection is not displayed if there is no data in the collection. (at least none of the tools I use are displayed.)


does anyone know what's going on?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3728a-2b8c3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3728a-2b8c3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?