Documentation error for "explain"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 1.4.0
    • Affects Version/s: 1.3.0
    • Component/s: Docs, libmongoc
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Here's the current docs and code.

      /* MongoDB 3.2+, "explain" command syntax */
      command = BCON_NEW ("explain", "{",
                          "find", BCON_UTF8 ("collection_name"),
                          "filter", "{",
                          "foo", BCON_INT32 (1), "}",
                          "}", "}");
      cursor = mongoc_collection_find (collection, MONGOC_QUERY_NONE, 0, 0, 0, query, NULL, NULL);
      

      The two problems are imbalanced braces and not using the command syntax. I believe it should be:

      command = BCON_NEW ("explain", "{",
                          "find", BCON_UTF8 ("collection_name"),
                          "filter", "{",
                          "foo", BCON_INT32 (1), "}",
                          "}");
      mongoc_collection_command_simple (collection, command, NULL, &reply, &error)
      

      Thanks,
      Kevin

              Assignee:
              A. Jesse Jiryu Davis
              Reporter:
              Kevin Arhelger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: