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

BI-Connector customerFilter Docs Provide Non-Working Examples

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      On: https://docs.mongodb.com/bi-connector/master/reference/mongodrdl/#custom-filter-example

      All of the statements include erroneous quotations around _MONGOFILTER which will cause queries to fail.

      Example:

      SELECT <normal>
         FROM <tablename>
         WHERE <normal conditions> AND
             "_MONGOFILTER"='{ <json string that represents query to use> }'
      

      The correct example should read:

      SELECT <normal>
         FROM <tablename>
         WHERE <normal conditions> AND
             _MONGOFILTER='{ <json string that represents query to use> }'
      

      Here are working example outputs from the shell:

      mysql> select * from account where city="New York City" and _MONGOFILTER='{"state":"active"}';
      +--------------------------+---------+---------------+--------+
      | _id                      | account | city          | state  |
      +--------------------------+---------+---------------+--------+
      | 59b809752653c6776420a33f | 1       | New York City | active |
      | 59b8097b2653c6776420a340 | 2       | New York City | active |
      | 59b809812653c6776420a341 | 3       | New York City | active |
      | 59b8099d2653c6776420a343 | 5       | New York City | active |
      | 59b809a42653c6776420a344 | 6       | New York City | active |
      +--------------------------+---------+---------------+--------+
      5 rows in set (0.01 sec)
      
      mysql> select * from account where _MONGOFILTER='{"state":"active"}';
      +--------------------------+---------+---------------+--------+
      | _id                      | account | city          | state  |
      +--------------------------+---------+---------------+--------+
      | 59b809752653c6776420a33f | 1       | New York City | active |
      | 59b8097b2653c6776420a340 | 2       | New York City | active |
      | 59b809812653c6776420a341 | 3       | New York City | active |
      | 59b8099d2653c6776420a343 | 5       | New York City | active |
      | 59b809a42653c6776420a344 | 6       | New York City | active |
      | 59b809c82653c6776420a347 | 9       | Austin        | active |
      | 59b809cd2653c6776420a348 | 10      | Austin        | active |
      | 59b809d12653c6776420a349 | 11      | Austin        | active |
      | 59b809ee2653c6776420a34b | 13      | London        | active |
      | 59b80a012653c6776420a34d | 15      | London        | active |
      +--------------------------+---------+---------------+--------+
      10 rows in set (0.01 sec)
      

      And a failed example:

      mysql> select * from account where city="New York City" and "_MONGOFILTER"='{"state":"active"}';
      Empty set (0.00 sec)
      

      Please let me know if you have any questions.

            Assignee:
            steve.renaker@mongodb.com Steve Renaker (Inactive)
            Reporter:
            kip.iwakiri@mongodb.com Kip Iwakiri (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 32 weeks ago