Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes

Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes

Author:Simon Holmes [Unknown]
Language: eng
Format: epub, pdf
Publisher: Manning Publications


The eagle-eyed among us may have noticed something strange in the select statement:

.select('-reviews -rating')

Previously we’ve used the select method to say which columns we do want to select. By adding a dash in front of a path name we’re stating that we don’t want to retrieve it from the database. So this select statement says to retrieve everything except the reviews and the rating.

6.5.2. Updating an existing subdocument in MongoDB

Updating a subdocument is exactly the same as updating a document, with one exception. After finding the document you then have to find the correct subdocument to make your changes. After this, the save method is applied to the document, not the subdocument. So the steps to updating an existing subdocument are



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.