How to create a view using node driver?

236 views
Skip to first unread message

Andrej Rapoport

unread,
Mar 29, 2018, 7:56:57 PM3/29/18
to mongodb-user
Hi,

is it possible to create views using the Node.js MongoDB Driver (3.0)? There is no db.createView() in the driver's API reference...

Thanks!

Andrej Rapoport

unread,
Mar 29, 2018, 8:30:52 PM3/29/18
to mongodb-user
I found it myself.  It can be done with the command method

client.db("db1").command( { create: "viewName", viewOn: "collectionName", pipeline: [ ... ]  });


Reply all
Reply to author
Forward
0 new messages