updated mongo notes for 'distinct'

This commit is contained in:
Chandra Mohan Jha 2020-02-12 12:09:46 +05:30
parent 2c9ff796fa
commit 3f93f3f953
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@
` db.<collection_name>.findOne({<key-value pair condition>}) ` show the first object in collection; condition is optional
` db.<collection_name>.distinct('<property_name>) ` list all the distinct values present for given property
` db.<collection_name>.update() ` update the object.
- `.update({<mathcing_condition>}, {<updated_value>}, {upsert: true/false}) ` If the upsert value is true then the new object is created if there is no object with given matching condition otherwise ignores
- ` <update_value> ` If the object is given directly, then it will override the content of previous object