Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2653

Suggestion for /manual/tutorial/remove-documents/

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • v1.3.1
    • 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().

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              10 years, 11 weeks ago