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

Ensure example code is consistent with docs processes



    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc0
    • Component/s: Documentation
    • Labels:


      (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:


      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.




            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: