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

Rationalize language for tags and tag sets

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual
    • None

    Description

      As part of my work on the Server Selection Spec, I've introduced a standard terminology for discussing tags and tags sets. I think this should be used to revise all the MongoDB manual documentation that discusses tags.

      • tag: a key/value pair (arbitrarily chosen by users who ascribe some semantics to it)
      • tag set: a document of zero or more tags
      • tag set list: ordered list of tag sets

      For example, read preferences optionally include a tag set list (except mode 'primary'). The first tag set in the list that matches at least one secondary in the replica set is used to choose secondaries eligible for reads.

      In particular, the manual should be careful using the term "tags", which has sometimes been used to mean "tag set" and sometimes to mean "tag set list". Ideally, it would only refer to multiple key value pairs and not to a complete tag set document.

      That allows clearer explanation of things like tag set matching. E.g. if all the tags (i.e. key/value pairs) in tag set A are present in tag set B, then A matches B.

      As an example of where "tags" confusion lies, for a replica set member, the "tags" field is a tag set. But in the read preference query modifier "tags" is a tag set list:

      db.collection.find().readPref( { mode: 'nearest', tags: [ {'dc': 'east'} ] } )

      While we can't change the server's use of "tags", we can try to be clearer in the documentation.

      Attachments

        Activity

          People

            andrew.aldridge@mongodb.com Andrew Aldridge
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 45 weeks, 5 days ago