Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1530

Ensure example code is consistent with docs processes

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.0, 3.7.0-beta1
    • Affects Version/s: None
    • Component/s: Documentation
    • None

      (Mostly copy/pasted from https://mongodbcr.appspot.com/189650001/)

      Investigate which code in examples/ is actually used in documentation and ensure that unused examples are either used, merged with used examples, or deleted?

      Long ago the C++ driver team was asked to write examples as part of the 'rosetta stone' of drivers examples. We didn't like that we were supposed to write those in a way that was disconnected to the repo (e.g. just as docs).

      So we put in annotations so we could have the docs team auto-extract them, and that way if we changed them in the code they would be updated.

      I don't know what happened with all of that, but we were annotating examples as follows:

      https://github.com/mongodb/mongo-cxx-driver/blob/master/examples/mongocxx/query.cpp#L42 https://github.com/mongodb/mongo-cxx-driver/blob/master/examples/mongocxx/query.cpp#L47

      Then it appears that at some point this work was lost, and then done again, under the mongodb.com/documentation_examples.cpp file:

      https://github.com/mongodb/mongo-cxx-driver/blob/master/examples/mongocxx/mongodb.com/documentation_examples.cpp#L36

      If the new files under mongodb.com are the right way to do it, then we should at least strip out the old annotations? I'm also puzzled about why that prior art got lost in the shuffle.

            Assignee:
            roberto.sanchez@mongodb.com Roberto Sanchez
            Reporter:
            ryan.timmons@mongodb.com Ryan Timmons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: