mgo查询针对大型数据集返回“ EOF”

I want to perform a query that returns some data from my MongoDB server, but when the amount of data becomes big I get an "EOF" error from the c.Find().All() query.

Basically I have:

activeData := []DataEntry{}
activeDataQuery := bson.M{"data.active": true}
err := sigdb.Find(activeDataQuery).All(&activeData)

Which works fine for a small test with about 50,000 items, but when I try my full dataset, which is more than one million items, it returns "EOF", eventhough there is data there to be queried.

What could be causing this? I am running both the Go program nad the MongoDB server on my laptop running Ubuntu 14.04 using Go 1.3.

Edit: Upon further trials, I am also getting: "write tcp 127.0.0.1:27017: broken pipe" from the same query.

查看全部
dongqiangou5724
dongqiangou5724
2015/03/05 18:12
  • mongodb
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复