Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mong.js 574B

12345678910111213141516171819202122
  1. var db = db.getSiblingDB('om');
  2. // Delete all collections + all records
  3. //db.messages.deleteMany({});
  4. //db.tags.deleteMany({});
  5. //db.users.deleteMany({});
  6. //db.sessions.deleteMany({});
  7. // Insert data in collections
  8. //load('mong_msg.js');
  9. load('mong_tag.js');
  10. load('mong_usr.js');
  11. // Print all collections + records count
  12. var collections = db.getCollectionNames();
  13. print('Collections inside the db:');
  14. for(var i = 0; i < collections.length; i++){
  15. var name = collections[i];
  16. if(name.substr(0, 6) != 'system')
  17. print(name + ' - ' + db[name].count() + ' records');
  18. }