mongodb calls on DB's rather than collections

When I do a find on a mongoclient rather than a collection
clnt: MongoClient,

...

const fullCollectionCursorPair = await clnt.runCommand(dbname, {
find: collectionName,
filter: {},
});
clnt: MongoClient,

...

const fullCollectionCursorPair = await clnt.runCommand(dbname, {
find: collectionName,
filter: {},
});
I get a cursor with the proper looking data but without .hasNext() , .next() .map() or .toArray() defined on it as I would if I was using collection.find Is there a way for me to attach them? It looks like this normally defined in class CommandCursor<T> in denodrivers/mongo/src/protocol/
1 Reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View