RejectedSoftware Forums

Sign up

How to find all in MongoDB?

I try to find all docs in collection like this:
posts.find(Bson())
or
posts.find([""])

And i get error in runtime:
500 - Internal Server Error

Internal Server Error

Internal error information:
object.Exception@/opt/vibe/source/vibe/core/drivers/libevent2_tcp.d(270):
Remote hung up while operating on TCPConnection.

/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(pure
@safe bool std.exception.enforce!(bool).enforce(bool, lazy
const(char)[], immutable(char)[], uint)+0x2c) [0x815e1b8]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.core.drivers.libevent2tcp.Libevent2TcpConnection.checkConnected()+0x7d)
[0x8192bb1]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.core.drivers.libevent2
tcp.Libevent2TcpConnection.read(ubyte[])+0x4e)
[0x819273e]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.db.mongo.connection.MongoConnection.recv(ubyte[])+0x43)
[0x81aae37]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(int
vibe.db.mongo.connection.MongoConnection.recvInt()+0x1e)
[0x81aad2e]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.connection.Reply
vibe.db.mongo.connection.MongoConnection.recvReply(int)+0x20)
[0x81aa950]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.connection.Reply
vibe.db.mongo.connection.MongoConnection.call(vibe.db.mongo.connection.Message)+0x22)
[0x81aabf2]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.connection.Reply
vibe.db.mongo.connection.MongoConnection.query(immutable(char)[],
vibe.db.mongo.connection.QueryFlags, int, int,
vibe.data.bson.Bson, vibe.data.bson.Bson)+0xc8) [0x81aa648]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.cursor.MongoCursor
vibe.db.mongo.collection.MongoCollection.find!(vibe.data.bson.Bson,
).find(vibe.data.bson.Bson, ,
vibe.db.mongo.connection.QueryFlags, int, int)+0xaa) [0x814b72a]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
app.index(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)+0x90) [0x814b490]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
std.functional.DelegateFaker!(void
function(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)).DelegateFaker.doIt(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)+0x45) [0x816c5bd]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.http.router.UrlRouter.handleRequest(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)+0x129) [0x81a62ed]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(bool
vibe.http.server.handleRequest(vibe.stream.stream.Stream,
immutable(char)[], vibe.http.server.HTTPServerListener, ref
vibe.http.server.HttpServerSettings)+0xdec) [0x81cd708]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.http.server.handleHttpConnection(vibe.core.driver.TcpConnection,
vibe.http.server.HTTPServerListener)+0x143) [0x81cc8a3]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.http.server.listenHttpPlain(vibe.http.server.HttpServerSettings,
void delegate(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)).void
doListen(vibe.http.server.HttpServerSettings,
vibe.http.server.HTTPServerListener, immutable(char)[]).void
__lambda31(vibe.core.driver.TcpConnection)+0x27) [0x81ca66f]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(extern
(C) void vibe.core.drivers.libevent2_tcp.onConnect(int, short,
void
).void ClientTask.execute()+0x200) [0x8193220]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.core.core.CoreTask.run()+0x5d) [0x81521d9]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
core.thread.Fiber.run()+0x21) [0x81fc1f1]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(fiber_entryPoint+0x4e)
[0x81fc12e]
[(nil)]

Re: How to find all in MongoDB?

The correct call is posts.find(Bson.EmptyObject). I'll have to check why
the connection is reset for the other variants though...

Am 25.08.2012 21:52, schrieb Sergey:

I try to find all docs in collection like this:
posts.find(Bson())
or
posts.find([""])

And i get error in runtime:
500 - Internal Server Error

Internal Server Error

Internal error information:
object.Exception@/opt/vibe/source/vibe/core/drivers/libevent2_tcp.d(270): Remote
hung up while operating on TCPConnection.

/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(pure @safe
bool std.exception.enforce!(bool).enforce(bool, lazy const(char)[],
immutable(char)[], uint)+0x2c) [0x815e1b8]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.core.drivers.libevent2tcp.Libevent2TcpConnection.checkConnected()+0x7d)
[0x8192bb1]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.core.drivers.libevent2
tcp.Libevent2TcpConnection.read(ubyte[])+0x4e)
[0x819273e]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.db.mongo.connection.MongoConnection.recv(ubyte[])+0x43) [0x81aae37]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(int
vibe.db.mongo.connection.MongoConnection.recvInt()+0x1e) [0x81aad2e]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.connection.Reply
vibe.db.mongo.connection.MongoConnection.recvReply(int)+0x20) [0x81aa950]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.connection.Reply
vibe.db.mongo.connection.MongoConnection.call(vibe.db.mongo.connection.Message)+0x22)
[0x81aabf2]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.connection.Reply
vibe.db.mongo.connection.MongoConnection.query(immutable(char)[],
vibe.db.mongo.connection.QueryFlags, int, int, vibe.data.bson.Bson,
vibe.data.bson.Bson)+0xc8) [0x81aa648]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(vibe.db.mongo.cursor.MongoCursor
vibe.db.mongo.collection.MongoCollection.find!(vibe.data.bson.Bson,
).find(vibe.data.bson.Bson, , vibe.db.mongo.connection.QueryFlags, int,
int)+0xaa) [0x814b72a]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
app.index(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)+0x90) [0x814b490]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
std.functional.DelegateFaker!(void
function(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)).DelegateFaker.doIt(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)+0x45) [0x816c5bd]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.http.router.UrlRouter.handleRequest(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)+0x129) [0x81a62ed]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(bool
vibe.http.server.handleRequest(vibe.stream.stream.Stream,
immutable(char)[], vibe.http.server.HTTPServerListener, ref
vibe.http.server.HttpServerSettings)+0xdec) [0x81cd708]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.http.server.handleHttpConnection(vibe.core.driver.TcpConnection,
vibe.http.server.HTTPServerListener)+0x143) [0x81cc8a3]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.http.server.listenHttpPlain(vibe.http.server.HttpServerSettings,
void delegate(vibe.http.server.HttpServerRequest,
vibe.http.server.HttpServerResponse)).void
doListen(vibe.http.server.HttpServerSettings,
vibe.http.server.HTTPServerListener, immutable(char)[]).void
__lambda31(vibe.core.driver.TcpConnection)+0x27) [0x81ca66f]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(extern (C)
void vibe.core.drivers.libevent2_tcp.onConnect(int, short, void
).void
ClientTask.execute()+0x200) [0x8193220]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
vibe.core.core.CoreTask.run()+0x5d) [0x81521d9]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(void
core.thread.Fiber.run()+0x21) [0x81fc1f1]
/tmp/.rdmd-0/rdmd-app.d-9E010235A46EBDDBD7CF9667F5324106/app(fiber_entryPoint+0x4e)
[0x81fc12e]
[(nil)]