O'Reilly logo

Node.js, MongoDB and Angular Web Development, 2nd Edition by Caleb Dayley, Brendan Dayley, Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15Accessing MongoDB from Node.js

In Chapter 14, “Manipulating MongoDB Documents from Node.js,” you learned how to create and manipulate documents and got a brief glimpse into finding them using the find() method. This chapter takes a deeper look at accessing documents in a MongoDB collection using the MongoDB Node.js driver module.

There is much more to accessing documents than just returning everything in a collection. This chapter covers using the query object to limit which documents are returned as well as methods to limit the fields and number of documents in the query results. You also see how to count the number of documents that match query criteria without actually retrieving them from the server. This chapter also covers some advanced ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required