English 中文(简体)
找到从mongo 壳体中节省的数据(无产出)
原标题:Finding saved data from mongo shell (no output)

这里是初步化法。

mongoose.connect( mongodb://localhost/gpsdb );
var db = mongoose.connection;
db.on( open , function () {
  // now we can start talking
});

在成功开场白后,我保存了类似数据,给我留下了错误。

function saveGPSData(data){
  var newData = new GPSData(data);
  newData.save(function(err){
    if(err)
        return console.error(err);

  });
}

现在,在万戈,我正试图检索这一数据,但给我留下了空洞的产出。

> use gpsdb
> db.GPSData.find();
> 

这使我没有产出。 另外,我也能够发现哪些模式存在。

http://pastebin.com/K7QPYAx8"rel=“nofollow”http://pastebin.com/K7QPYAx8

JUST FOUND THAT in dbubeer where these file for my db caused by mongodb

/data/db/gpsdb.0
/data/db/gpsdb.1
/data/db/gpsdb.n
最佳回答

在炮弹中,我做了以下工作:

>use gpsdb
switched to gpsdb
>db show collections
gpsdatas

从这里我发现,收集名称是数据。 不清楚为什么在我的模式中增加额外的(s),尽管你们可以从我所制定的“Modal”法中看到,

var GPSData = mongoose.model( GPSData , GPSDataSchema);

如今,它像现在这样干活。

>db.gpsdatas.find()
问题回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签