-
Type: Bug
-
Resolution: Duplicate
-
Priority: 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.