Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1200

Documentation error for "explain"

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.4.0
    • Affects Version/s: 1.3.0
    • Component/s: Docs, libmongoc
    • 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:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            kevin.arhelger@mongodb.com Kevin Arhelger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: