Posted By

efleming969 on 01/29/10


Tagged

Scala sbt mongodb


Versions (?)

SBT MongoDB Task


 / Published in: Scala
 

  1. lazy val mongoRefresh = task {
  2.  
  3. log.info("Refreshing Mongo Database")
  4.  
  5. val sudo = new Mongo("localhost").getDB("sudo")
  6.  
  7. sudo.dropDatabase
  8.  
  9. val domains = new BasicDBList()
  10.  
  11. domains.add("localhost")
  12.  
  13. val devHost = BasicDBObjectBuilder.start("name", "dev")
  14. .add("domains", domains).get
  15.  
  16. sudo.getCollection("hosts").save(devHost)
  17.  
  18. None
  19. }

Report this snippet  

You need to login to post a comment.