Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
find メソッドを使用してデータベースにクエリを実行できず、空の配列が返されるかどうかを確認することはできますが、DB にオブジェクトがないかどうかを確認する特定のメソッドが Mongoose にありませんか?
mongoシェルでは、次のことができます:
if (db.getCollectionNames().length === 0) { // It's empty ... }
各言語のドライバーには、同等のものがあるはずです。