- db.<collection>.deleteOne({<field>: <value>})
- Deletes the first matching document
- db.<collection>.deleteMany({<field1>: {$gt: <num>}, <field2>:<bool>})
- Deletes all matching documents
- db.<collection>.deleteMany({<field1>: {$exists: <bool>}, <field2>:<bool>})
- Use of exists with deleteMany
- db.<collection>.deleteMany({});
- Deleting all documents in a collection
- db.<collection>.drop()
- Deletes collection all together (use carefully)
- db.dropDatabase()
- Deletes entire database
If you are getting the error: Uncaught TypeError: firebase.database is not a function Resolve it by including firebase-database.js in your html page as follows: <!-- The core Firebase JS SDK is always required and must be listed first --> <script defer src = "https://www.gstatic.com/firebasejs/6.2.4/firebase-app.js" ></script> <script defer src = "https://www.gstatic.com/firebasejs/3.1.0/firebase-database.js" ></script> That is it. Let me know if this was helpful.

Comments
Post a Comment