-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
I suggest adding a semi-colon after shell JS statements. Maybe you only want to do that for multi-line examples, though.
Inconsistent formatting: you use a local footnote to suggest using drop() instead of a remove() without criteria, but in the "Remove Documents that Matches a Condition" section, a "Note:" block is used. I think a "Note:" block could be used for both.
For readability, I think the following lines:
The following example removes all documents that have type equal to food from the inventory collection:
The following example removes one document that have type equal to food from the inventory collection
...could be rewritten as:
The following example removes X document(s) from the inventory collection where the type field is equal to food:
Should we explicitly mention that remove() is limited to removing all or a single document at present? As is, we mention both methods of operation, but don't really say anything about a limited removal not being possible. Would it make sense to link to SERVER-4796 since this is an upcoming feature, or do we typically not reference JIRA tickets in documentation?
Additionally, I think a relevant use case is removing one document with respect to a sort order (e.g. removing the oldest document by some criteria). The only way I know to do this is with findAndModify(). There actually isn't an example of doing so on the findAndModify() page (no examples for the remove option, in fact). I think this would be a relevant outbound link on the db.collection.remove() page: tell users that if they need to remove a single document by some sort criteria, they can use findAndModify().