dan.the.discloserD
Denoβ€’4y agoβ€’
1 reply
dan.the.discloser

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: {},
  });


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/
Was this page helpful?