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

mongodb calls on DB's rather than collections

When I do a
find
find
on a
mongoclient
mongoclient
rather than a
collection
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()
.hasNext()
,
.next()
.next()
.map()
.map()
or
.toArray()
.toArray()


defined on it as I would if I was using

collection.find
collection.find


Is there a way for me to attach them?


It looks like this normally defined in
class CommandCursor<T>
class CommandCursor<T>
in

denodrivers/mongo/src/protocol/
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

DB Connection slow with mongodb
Andre78AAndre78 / help
13mo ago
MongoDB connection error on Deno Deploy
tas13Ttas13 / help
3y ago
mongodb indexes
dan.the.discloserDdan.the.discloser / help
4y ago