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 534B

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