You are not logged in.
Pages: 1
Hello, I realized that with version 3.0 you can not receive the collection list using this method:
constructor TMongoDatabase
[..]
if colls.Init(Client.Connections[0].GetBSONAndFree(
TMongoRequestQuery.Create(aDatabaseName+'.system.namespaces',null,'name',maxInt))) then
// e.g. [ {name:"test.system.indexes"}, {name:"test.test"} ]
while colls.Next do begin
full := colls.item.DocItemToRawUTF8('name');
if full<>'' then begin
split(full,'.',db,coll);
if db<>aDatabaseName then
raise EMongoConnectionException.CreateUTF8(
'%.Create: invalid "%" collection name for DB "%"',
[self,full,aDatabaseName],Client.Connections[0]);
fCollections.AddObject(coll,TMongoCollection.Create(self,coll));
end;
end;
I made a change to use the new method (listCollections):
Client.Connections[0].RunCommand(aDatabaseName,'listCollections',Vresponse);
if not varisnull(Vresponse) then
begin
for t:=0 to Vresponse.cursor.firstBatch._count-1 do
begin
v:=Vresponse.cursor.firstBatch._(t);
coll:=V.name;
if coll<>'' then
fCollections.AddObject(coll,TMongoCollection.Create(self,coll));
end;
end;
Offline
Please check http://synopse.info/fossil/info/512a3e3265
Thanks for the feedback!
Offline
Pages: 1