我有一个Mongodb集合,它只有两列:user和url。它有39274590行。表的键是{user,url}。
使用Java,我尝试列出不同的URL:
MongoDBManager db = new MongoDBManager( "Website", "UserLog" );
return db.getDistinct("url");
但是我收到了一个异常:
Exception in thread "main" com.mongodb.CommandResult$CommandFailure: command failed [distinct]:
{ "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: distinct too big, 16mb cap" , "code" : 10044 , "ok" : 0.0}
我该如何解决这个问题?是否有备选方案可以避免这个问题?