dot_mongorc.js 606 B

12345678910111213141516
  1. search = function(id) {
  2. return db.getMongo().getDBNames().map((database) => {
  3. let sibling = db.getSiblingDB(database);
  4. return sibling.getCollectionNames().map((collection) => sibling.getCollection(collection).findOne({"_id" : ObjectId(id)})).filter((notNull) => notNull);
  5. }).filter(String)
  6. }
  7. variety = function(id) {
  8. return db.getMongo().getDBNames().map((database) => {
  9. let sibling = db.getSiblingDB(database);
  10. sibling.getCollectionNames().map((collection) => {
  11. return (typeof(sibling.getCollection(collection)))
  12. })
  13. }).filter(String)
  14. }