[DOCS-10780] BI-Connector customerFilter Docs Provide Non-Working Examples Created: 12/Sep/17  Updated: 20/Sep/17  Resolved: 20/Sep/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kip Iwakiri (Inactive) Assignee: Steve Renaker (Inactive)
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Participants:
Days since reply: 6 years, 21 weeks ago

 Description   

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.



 Comments   
Comment by Steve Renaker (Inactive) [ 20/Sep/17 ]

Duplicate of DOCSP-1168

Comment by Steve Renaker (Inactive) [ 20/Sep/17 ]

This ticket is a duplicate of DOCSP-1168. I'll close it as such.

Generated at Thu Feb 08 08:01:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.