2013-08-25 36 views
0

我在这里学习曲线的低端,所以请原谅简单的问题。找不到()来自Play的记录!应用程序使用mongoDB

我已经设置了我的第一个Play应用程序,并使用mongoDB数据库实现了他们的TodoList教程。我的代码基本上反映了这个代码:https://github.com/Mironor/Play-2.0-Scala-MongoDb-Salat-exemple

应用程序工作正常,但是当我使用命令行,我找不到任何记录:

$ mongo 
> show dbs 
local (empty) 
todo 0.0625GB 
> db.todo.find() 
> db.todo.tasks.find() 
> 
  • 我知道todo数据库是一个我想,因为当我砸我数据消失。
  • 我知道在那里,因为我可以看到他们在应用
  • 我想我应该找到db.todo.tasks这些记录,因为它是specified by the model

那么,如何找到命令这些记录记录线控制台?

回答

1

todo是数据库,tasks是集合。试试这个:

> use todo; 
switched to db todo 
> db.tasks.find(); 

在MongoDB的壳use命令需要来挑选你的数据库,然后才能查询集合。当你启动shell时,你可能从test分贝开始,所以没有办法从那里得到你的任务。